modules-Block: prepared different input options, grid-element: panel-background added -> icon always visible
This commit is contained in:
@@ -182,27 +182,26 @@ window.onload = function() {
|
||||
let array_icon_edit = document.getElementsByClassName('icon-edit');
|
||||
let array_button = document.getElementsByClassName('input-element-button');
|
||||
if (writePermission == false) {
|
||||
// TODO: here instead of asking "Please confirm we are on <instrument>", do not show the instrument,
|
||||
// ask the user "Please confrim the instrument:" and check it the entered instrument is correct
|
||||
// (case insensitive)
|
||||
alertify.confirm("WRITE PERMISSION", "Current device: <b>"+ window.device
|
||||
+ "</b>. Please confirm we are on <b>" + window.instrument + "</b>",
|
||||
function () {
|
||||
// User decided to proceed.
|
||||
prompt = false;
|
||||
|
||||
writePermission = true;
|
||||
icon_lock_container.innerHTML = '<img class = "icon-main icon-lock" src="res/icon_lock_open.png">';
|
||||
for(i = 0; i < array_icon_edit.length; i++) {
|
||||
array_icon_edit[i].classList.remove('icon-edit-hidden');
|
||||
}
|
||||
for(i = 0; i < array_button.length; i++) {
|
||||
array_button[i].classList.remove('input-element-button-hidden');
|
||||
alertify.prompt( 'WRITE PERMISSION', "Please enter the name of the instrument you want to work on."
|
||||
, function(evt, value) {
|
||||
// User decided to proceed
|
||||
if (clientTitle.includes(value)) {
|
||||
writePermission = true;
|
||||
icon_lock_container.innerHTML = '<img class = "icon-main icon-lock" src="res/icon_lock_open.png">';
|
||||
for(i = 0; i < array_icon_edit.length; i++) {
|
||||
array_icon_edit[i].classList.remove('icon-edit-hidden');
|
||||
}
|
||||
for(i = 0; i < array_button.length; i++) {
|
||||
array_button[i].classList.remove('input-element-button-hidden');
|
||||
}
|
||||
} else {
|
||||
console.log(clientTitle);
|
||||
}
|
||||
// prompt = false;
|
||||
}
|
||||
, function () {
|
||||
, function() {
|
||||
// User decided to cancel
|
||||
prompt = false;
|
||||
prompt = false;
|
||||
});
|
||||
} else {
|
||||
writePermission = false;
|
||||
|
||||
Reference in New Issue
Block a user