summaryrefslogtreecommitdiff
path: root/web/share/js/tools.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/share/js/tools.js')
-rw-r--r--web/share/js/tools.js11
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");
+ },
};
};