Added active tab using hash from URL feature, as requested in issue #203

(cherry picked from commit bcb74d0)
This commit is contained in:
Marc Hannappel 2016-12-21 10:51:19 +01:00 committed by Gina Häußge
parent 0560e9da02
commit f2bd5d605e

View file

@ -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");
};