Andrew's git
/
newtab.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
fix event listener bug for items & add buttons
author
Andrew Lorimer
<andrew@lorimer.id.au>
Sat, 17 Aug 2019 13:35:13 +0000
(23:35 +1000)
committer
Andrew Lorimer
<andrew@lorimer.id.au>
Sat, 17 Aug 2019 13:35:13 +0000
(23:35 +1000)
admin.js
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
e32738a
)
diff --git
a/admin.js
b/admin.js
index 224e69288fc69addce40751dae26381997786b16..ea20d86d1642c1ac25ff925659a41b8621922f29 100644
(file)
--- a/
admin.js
+++ b/
admin.js
@@
-168,6
+168,7
@@
function drop(e) {
dragSrcEl.innerHTML = this.innerHTML;
this.innerHTML = e.dataTransfer.getData('text/html');
save();
dragSrcEl.innerHTML = this.innerHTML;
this.innerHTML = e.dataTransfer.getData('text/html');
save();
+ menu();
}
return false;
}
}
return false;
}
@@
-314,7
+315,7
@@
function listen(li) {
} else {
addItem(r, li);
}
} else {
addItem(r, li);
}
- },
fals
e);
+ },
tru
e);
}
function addItem(caller, li) {
}
function addItem(caller, li) {
@@
-380,12
+381,14
@@
function addItem(caller, li) {
span.onmouseout = function() {
this.style.background = hoverbg2;
};
span.onmouseout = function() {
this.style.background = hoverbg2;
};
+ menu(); // TODO fix bug where form save button loses its eventlistener after generating form for another column twice
fields = document.querySelector("#"+id+" .new .name");
fields.focus();
}
function menu() {
fields = document.querySelector("#"+id+" .new .name");
fields.focus();
}
function menu() {
+ // Update event listeners for all items, their remove buttons, and the add button for each column
var allUserLi = document.querySelectorAll('.remove, .add');
allUserLi.forEach(function(li, p_index){
var allUserLi = document.querySelectorAll('.remove, .add');
allUserLi.forEach(function(li, p_index){