diff options
author | Devaev Maxim <[email protected]> | 2019-04-24 22:32:53 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-04-24 22:32:53 +0300 |
commit | 3d64401b111d863072c74e81e49de68885c0e084 (patch) | |
tree | b342b911f0836f65fee8163c77c54d004661f2da /web/share/js/tools.js | |
parent | 3ecd337b3a259432546e883bc82d83389e0d6aba (diff) |
ipad mouse buttons, keyboard refactoring
Diffstat (limited to 'web/share/js/tools.js')
-rw-r--r-- | web/share/js/tools.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/web/share/js/tools.js b/web/share/js/tools.js index 89b90978..0cae6566 100644 --- a/web/share/js/tools.js +++ b/web/share/js/tools.js @@ -25,6 +25,12 @@ var tools = new function() { this.forEach = (...args) => Array.prototype.forEach.call(...args); + this.setDefault = function(dict, key, value) { + if (!(key in dict)) { + dict[key] = value; + } + }; + this.makeRequest = function(method, url, callback, body=null, content_type=null) { var http = new XMLHttpRequest(); http.open(method, url, true); |