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