1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00
appwrite/public/scripts/views/forms/move-down.js
2020-03-16 20:41:56 +02:00

19 lines
515 B
JavaScript

(function(window) {
"use strict";
window.ls.container.get("view").add({
selector: "data-forms-move-down",
controller: function(element) {
Array.prototype.slice
.call(element.querySelectorAll("[data-move-down]"))
.map(function(obj) {
obj.addEventListener("click", function() {
if (element.nextElementSibling) {
element.parentNode.insertBefore(element.nextElementSibling, element);
}
});
});
}
});
})(window);