summaryrefslogtreecommitdiff
path: root/js/App.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-03-06 22:41:46 +0300
committerAndrew Dolgov <[email protected]>2021-03-06 22:41:46 +0300
commit1d9fa2a42e2cad9ea76ad22edf8919942c853be1 (patch)
tree19f82a883aebd76871d94c81692a26f8aad3d73a /js/App.js
parent7b0b5b55c7a7e0f5e5f63083a5131ea85109bbec (diff)
reduce overhead in hash set/get
Diffstat (limited to 'js/App.js')
-rw-r--r--js/App.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/js/App.js b/js/App.js
index f792cf2e1..82ec26c2f 100644
--- a/js/App.js
+++ b/js/App.js
@@ -18,6 +18,15 @@ const App = {
is_prefs: false,
LABEL_BASE_INDEX: -1024,
_translations: {},
+ Hash: {
+ get: function() {
+ return dojo.queryToObject(window.location.hash.substring(1));
+ },
+ set: function(params) {
+ const obj = dojo.queryToObject(window.location.hash.substring(1));
+ window.location.hash = dojo.objectToQuery({...obj, ...params});
+ }
+ },
l10n: {
ngettext: function(msg1, msg2, n) {
return self.__((parseInt(n) > 1) ? msg2 : msg1);
@@ -1269,6 +1278,6 @@ const App = {
default:
console.log("quickMenuGo: unknown action: " + opid);
}
- }
+ },
}