fix some rough spots in the drag-and-drop UI
This commit is contained in:
parent
a7528c859a
commit
482cba6d95
|
|
@ -148,3 +148,21 @@
|
||||||
#cb_phantom > .cb-lt-piece {
|
#cb_phantom > .cb-lt-piece {
|
||||||
left: 22.5%;
|
left: 22.5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.noselect {
|
||||||
|
cursor: default;
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cb_board .cb-piece.ui-draggable {
|
||||||
|
cursor: grab;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cb_board .cb-piece.ui-draggable-disabled {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
|
||||||
16
index.html
16
index.html
|
|
@ -13,7 +13,7 @@
|
||||||
<div id="cb_outer">
|
<div id="cb_outer">
|
||||||
<div id="cb_container">
|
<div id="cb_container">
|
||||||
<div id="cb_inner">
|
<div id="cb_inner">
|
||||||
<table id="cb_board">
|
<table id="cb_board" class="noselect">
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="cb-horiz-label"><div>A</div></td>
|
<td class="cb-horiz-label"><div>A</div></td>
|
||||||
|
|
@ -141,12 +141,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<form id="cb_control_form">
|
<form id="cb_control_form" onsubmit="return false;">
|
||||||
<div id="cb_controls">
|
<div id="cb_controls">
|
||||||
<button id="cb_undo" disabled="true">Undo</button>
|
<button id="cb_undo" type="button" disabled="true">Undo</button>
|
||||||
<button id="cb_redo" disabled="true">Redo</button>
|
<button id="cb_redo" type="button" disabled="true">Redo</button>
|
||||||
<button id="cb_reset">Reset</button>
|
<button id="cb_reset" type="button">Reset</button>
|
||||||
<button id="cb_pass">Pass</button>
|
<button id="cb_pass" type="button">Pass</button>
|
||||||
<span id="cb_message"></span><br>
|
<span id="cb_message"></span><br>
|
||||||
</div>
|
</div>
|
||||||
<div id="cb_names">
|
<div id="cb_names">
|
||||||
|
|
@ -183,7 +183,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top: 1em; display: none">
|
<div style="margin-top: 1em; display: none">
|
||||||
<form id="sign">
|
<form id="sign" onsubmit="return false;">
|
||||||
<input id="alias" placeholder="username">
|
<input id="alias" placeholder="username">
|
||||||
<input id="pass" type="password" placeholder="passphrase">
|
<input id="pass" type="password" placeholder="passphrase">
|
||||||
<input id="in" type="submit" value="sign in">
|
<input id="in" type="submit" value="sign in">
|
||||||
|
|
@ -194,7 +194,7 @@
|
||||||
<div id="todo" style="display: none">
|
<div id="todo" style="display: none">
|
||||||
<ul id="todo_list"></ul>
|
<ul id="todo_list"></ul>
|
||||||
|
|
||||||
<form id="said">
|
<form id="said" onsubmit="return false;">
|
||||||
<input id="say">
|
<input id="say">
|
||||||
<input id="speak" type="submit" value="speak">
|
<input id="speak" type="submit" value="speak">
|
||||||
<input id="sign_out" type="button" value="sign out">
|
<input id="sign_out" type="button" value="sign out">
|
||||||
|
|
|
||||||
|
|
@ -454,8 +454,11 @@ function renderBoard(board){
|
||||||
$('#cb_board .ui-draggable').draggable('disable');
|
$('#cb_board .ui-draggable').draggable('disable');
|
||||||
$('#cb_phantom .ui-draggable-disabled').filter(clss).draggable('enable');
|
$('#cb_phantom .ui-draggable-disabled').filter(clss).draggable('enable');
|
||||||
} else {
|
} else {
|
||||||
|
$('#cb_board .ui-draggable').draggable('disable');
|
||||||
|
if (!board['move'] || !board['move']['took'] || board['move']['took'][0] !== 'k') {
|
||||||
$('#cb_board .ui-draggable-disabled').filter(clss).draggable('enable');
|
$('#cb_board .ui-draggable-disabled').filter(clss).draggable('enable');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (board['move']) {
|
if (board['move']) {
|
||||||
if (board['move']['from'] === 'phantom') {
|
if (board['move']['from'] === 'phantom') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue