upload image by url in web ui

This commit is contained in:
Maxim Devaev
2021-08-01 21:25:26 +03:00
parent f5c1908657
commit 5933cc0b09
4 changed files with 154 additions and 84 deletions

View File

@@ -211,11 +211,22 @@ export var tools = new function() {
};
};
self.input = new function() {
return {
"getFile": function(el) {
return (el.files.length ? el.files[0] : null);
},
};
};
self.hidden = new function() {
return {
"setVisible": function(el, visible) {
el.classList.toggle("hidden", !visible);
},
"isVisible": function(el) {
return !el.classList.contains("hidden");
},
};
};