mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 08:28:42 +00:00
19 lines
519 B
JavaScript
19 lines
519 B
JavaScript
|
|
(function(window) {
|
||
|
|
"use strict";
|
||
|
|
|
||
|
|
window.ls.container.get("view").add({
|
||
|
|
selector: "data-forms-move-up",
|
||
|
|
controller: function(element) {
|
||
|
|
Array.prototype.slice
|
||
|
|
.call(element.querySelectorAll("[data-move-up]"))
|
||
|
|
.map(function(obj) {
|
||
|
|
obj.addEventListener("click", function() {
|
||
|
|
if (element.previousElementSibling) {
|
||
|
|
element.parentNode.insertBefore(element, element.previousElementSibling);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
})(window);
|