mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
use left click
This commit is contained in:
parent
f2114b9a5f
commit
103db391fc
1 changed files with 10 additions and 6 deletions
|
|
@ -48,10 +48,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
}
|
||||
|
||||
const UNLOCK_EDIT_COUNT = 3;
|
||||
let rightClickCount = 0;
|
||||
function onRightClick() {
|
||||
rightClickCount += 1;
|
||||
if (rightClickCount == UNLOCK_EDIT_COUNT) {
|
||||
let clickCount = 0;
|
||||
function onClick() {
|
||||
clickCount += 1;
|
||||
if (clickCount == UNLOCK_EDIT_COUNT) {
|
||||
alert(tr.deckConfigManualParameterEditWarning());
|
||||
}
|
||||
}
|
||||
|
|
@ -65,8 +65,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
on:blur={update}
|
||||
class="w-100"
|
||||
placeholder={render(defaults)}
|
||||
disabled={rightClickCount < UNLOCK_EDIT_COUNT}
|
||||
on:contextmenu={onRightClick}
|
||||
readonly={clickCount < UNLOCK_EDIT_COUNT}
|
||||
on:click={onClick}
|
||||
></textarea>
|
||||
|
||||
<style>
|
||||
|
|
@ -74,4 +74,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
resize: none;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
textarea:read-only {
|
||||
opacity: 0.75;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue