use left click

This commit is contained in:
Luc Mcgrady 2025-10-02 14:03:34 +01:00
parent f2114b9a5f
commit 103db391fc
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C

View file

@ -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>