Change the cursor to match the selected spare piece when hovering over the spare piece. Still need to make the same cursor appear when hovering over the board.
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
|
@ -38,7 +38,6 @@ body.dark #board_editor .spare.white {
|
|||
height: 58.102px;
|
||||
}
|
||||
#board_editor .spare piece {
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
|
|
@ -141,8 +141,14 @@ function sparePieces(ctrl, color, orientation, position) {
|
|||
class: ['spare', position, 'orientation-' + orientation, color].join(' ')
|
||||
}, ['pointer', 'king', 'queen', 'rook', 'bishop', 'knight', 'pawn', 'trash'].map(function(role) {
|
||||
var piece = ((['pointer', 'trash'].indexOf(role) === -1) ? color + ' ' : '') + role,
|
||||
selectedParts = ctrl.vm.selected().split(' '),
|
||||
cursorName = selectedParts[0] + ((selectedParts.length >= 2) ? '-' + selectedParts[1] : ''),
|
||||
cursor = (cursorName === 'pointer') ?
|
||||
// http://www.cursors-4u.com
|
||||
cursorName : 'url(/assets/cursors/' + cursorName + '.cur), default !important',
|
||||
pieceElement = {
|
||||
class: piece
|
||||
class: piece,
|
||||
style: 'cursor: ' + cursor
|
||||
},
|
||||
containerClass = 'no-square' + ((ctrl.vm.selected() === piece) ? ' selected-square' : '');
|
||||
|
||||
|
|