Added active tab using hash from URL feature, as requested in issue #203
(cherry picked from commit bcb74d0)
This commit is contained in:
parent
0560e9da02
commit
f2bd5d605e
1 changed files with 17 additions and 0 deletions
|
|
@ -539,6 +539,15 @@ $(function() {
|
|||
// reload overlay
|
||||
$("#reloadui_overlay_reload").click(function() { location.reload(); });
|
||||
|
||||
var changeTab = function()
|
||||
{
|
||||
var hashtag = window.location.hash;
|
||||
|
||||
var tab = $('#tabs a[href="' + hashtag + '"]');
|
||||
tab.tab("show");
|
||||
onTabChange(hashtag);
|
||||
};
|
||||
|
||||
//~~ final initialization - passive login, settings fetch, view model binding
|
||||
|
||||
if (!_.has(viewModelMap, "settingsViewModel")) {
|
||||
|
|
@ -654,6 +663,14 @@ $(function() {
|
|||
callViewModels(allViewModels, "onBrowserTabVisibilityChange", [status]);
|
||||
});
|
||||
|
||||
$(window).on("hashchange", function() {
|
||||
changeTab();
|
||||
});
|
||||
|
||||
if (window.location.hash !== "") {
|
||||
changeTab();
|
||||
}
|
||||
|
||||
log.info("Application startup complete");
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue