Improve admin js.
Disable the button that opens a currently opened admin subform.
This commit is contained in:
parent
84fbf02521
commit
255569201b
11
res/admin.js
11
res/admin.js
@ -48,8 +48,13 @@
|
|||||||
f.appendChild(i);
|
f.appendChild(i);
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
function disable_one(one) {
|
||||||
|
p.querySelectorAll('button').forEach(function(b) {
|
||||||
|
b.disabled = (b === one);
|
||||||
|
})
|
||||||
|
}
|
||||||
function tag_form(event, category) {
|
function tag_form(event, category) {
|
||||||
//event.target.disabled = true; - FIXME?
|
disable_one(event.target);
|
||||||
var f = makeform(category);
|
var f = makeform(category);
|
||||||
var l = d.createElement("label");
|
var l = d.createElement("label");
|
||||||
l.innerHTML = event.target.title;
|
l.innerHTML = event.target.title;
|
||||||
@ -151,7 +156,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function grade_form(event) {
|
function grade_form(event) {
|
||||||
//event.target.disabled = true; - FIXME?
|
disable_one(event.target);
|
||||||
var grade = details.dataset.grade;
|
var grade = details.dataset.grade;
|
||||||
var f = makeform("grade");
|
var f = makeform("grade");
|
||||||
var l = d.createElement("label");
|
var l = d.createElement("label");
|
||||||
@ -202,7 +207,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function location_form(event) {
|
function location_form(event) {
|
||||||
//event.target.disabled = true; - FIXME?
|
disable_one(event.target);
|
||||||
var position = details.dataset.position || localStorage.getItem('lastpos');
|
var position = details.dataset.position || localStorage.getItem('lastpos');
|
||||||
var f = makeform("locate");
|
var f = makeform("locate");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user