refactor two mostly-identical functions

pull/1/head
ansuz 4 years ago
parent 59eaf8187c
commit c4e1b5f7d4

@ -148,20 +148,19 @@ define([
send(); send();
}; };
common.setTabHref = function (href) { (function () {
var ohc = window.onhashchange; var bypassHashChange = function (key) {
window.onhashchange = function () {}; return function (value) {
window.location.href = href; var ohc = window.onhashchange;
window.onhashchange = ohc; window.onhashchange = function () {};
ohc({reset: true}); window.location[key] = value;
}; window.onhashchange = ohc;
common.setTabHash = function (hash) { ohc({reset: true});
var ohc = window.onhashchange; };
window.onhashchange = function () {}; };
window.location.hash = hash; common.setTabHref = bypassHashChange('href');
window.onhashchange = ohc; common.setTabHash = bypassHashChange('hash');
ohc({reset: true}); }());
};
// RESTRICTED // RESTRICTED
// Settings only // Settings only

Loading…
Cancel
Save