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.

pull/2696/head
Brandon Evans 2017-02-18 09:46:17 -05:00
parent cf7eadab58
commit 2f349fd01b
15 changed files with 7 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -38,7 +38,6 @@ body.dark #board_editor .spare.white {
height: 58.102px;
}
#board_editor .spare piece {
cursor: pointer;
width: 100%;
height: 100%;
}

View File

@ -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' : '');