mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 20:57:13 -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;
|
const UNLOCK_EDIT_COUNT = 3;
|
||||||
let rightClickCount = 0;
|
let clickCount = 0;
|
||||||
function onRightClick() {
|
function onClick() {
|
||||||
rightClickCount += 1;
|
clickCount += 1;
|
||||||
if (rightClickCount == UNLOCK_EDIT_COUNT) {
|
if (clickCount == UNLOCK_EDIT_COUNT) {
|
||||||
alert(tr.deckConfigManualParameterEditWarning());
|
alert(tr.deckConfigManualParameterEditWarning());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -65,8 +65,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
on:blur={update}
|
on:blur={update}
|
||||||
class="w-100"
|
class="w-100"
|
||||||
placeholder={render(defaults)}
|
placeholder={render(defaults)}
|
||||||
disabled={rightClickCount < UNLOCK_EDIT_COUNT}
|
readonly={clickCount < UNLOCK_EDIT_COUNT}
|
||||||
on:contextmenu={onRightClick}
|
on:click={onClick}
|
||||||
></textarea>
|
></textarea>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -74,4 +74,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
resize: none;
|
resize: none;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea:read-only {
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue