diff options
author | Maxim Devaev <[email protected]> | 2021-08-01 21:25:26 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2021-08-01 21:25:26 +0300 |
commit | 5933cc0b09b4f37e7e5f714b23ab5993e6fc0b2c (patch) | |
tree | c8bbbc7edf6813dccd0e2e0d740b00d398af9b4e /web/share/js/tools.js | |
parent | f5c1908657489d496e786f0d6aa579d1b5500542 (diff) |
upload image by url in web ui
Diffstat (limited to 'web/share/js/tools.js')
-rw-r--r-- | web/share/js/tools.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/share/js/tools.js b/web/share/js/tools.js index b24864e2..10013727 100644 --- a/web/share/js/tools.js +++ b/web/share/js/tools.js @@ -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"); + }, }; }; |