Re-lock word form if dictionary is completed.
Broke out Lock and Unlock word form functions for use elsewhere.
This commit is contained in:
parent
7cf5eeb252
commit
cb9041c7ca
31
js/ui.js
31
js/ui.js
|
@ -209,11 +209,21 @@ function ToggleWordFormLock() {
|
|||
var wordForm = document.getElementById("wordEntryForm");
|
||||
|
||||
if (wordFormIsLocked()) { //If it is already locked, change it to Unlocked and get everything working as it needs to.
|
||||
UnlockWordForm();
|
||||
} else {
|
||||
LockWordForm();
|
||||
}
|
||||
}
|
||||
|
||||
function UnlockWordForm() {
|
||||
var lockButton = document.getElementById("formLockButton");
|
||||
var leftColumn = document.getElementById("leftColumn");
|
||||
var wordForm = document.getElementById("wordEntryForm");
|
||||
var wordFormWidth = wordForm.offsetWidth - 20;
|
||||
var leftColumnWidth = leftColumn.offsetWidth;
|
||||
var leftColumnHeight = leftColumn.offsetHeight;
|
||||
|
||||
lockButton.innerHTML = "🔓";
|
||||
lockButton.innerHTML = "🔓"; // Change to the "Unlocked lock" icon.
|
||||
|
||||
wordForm.style.position = "fixed";
|
||||
wordForm.style.top = document.getElementsByTagName("header")[0].offsetHeight.toString() + "px";
|
||||
|
@ -221,11 +231,16 @@ function ToggleWordFormLock() {
|
|||
|
||||
leftColumn.style.width = leftColumnWidth.toString() + "px";
|
||||
leftColumn.style.height = leftColumnHeight.toString() + "px";
|
||||
} else {
|
||||
lockButton.innerHTML = "🔒";
|
||||
}
|
||||
|
||||
function LockWordForm() {
|
||||
var lockButton = document.getElementById("formLockButton");
|
||||
var leftColumn = document.getElementById("leftColumn");
|
||||
var wordForm = document.getElementById("wordEntryForm");
|
||||
|
||||
lockButton.innerHTML = "🔒"; // Change to the "locked" icon.
|
||||
leftColumn.removeAttribute('style');
|
||||
wordForm.removeAttribute('style');
|
||||
}
|
||||
}
|
||||
|
||||
function CloseUpdateConflictArea(displayId) {
|
||||
|
@ -422,7 +437,13 @@ function ShowFilterWordCount(numberOfWords) {
|
|||
|
||||
function HideSettings() {
|
||||
document.getElementById("settingsScreen").style.display = "none";
|
||||
document.getElementById("wordEntryForm").style.display = (currentDictionary.settings.isComplete) ? "none" : "block";
|
||||
if (currentDictionary.settings.isComplete) {
|
||||
LockWordForm();
|
||||
document.getElementById("wordEntryForm").style.display = "none";
|
||||
} else {
|
||||
document.getElementById("wordEntryForm").style.display = "block";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function NewWordNotification(word) {
|
||||
|
|
Loading…
Reference in New Issue