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

This commit is contained in:
Marc Hannappel 2016-12-21 10:51:19 +01:00
parent 8a8b88af13
commit bcb74d01b6

View file

@ -478,6 +478,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);
}
//~~ view model binding
var bindViewModels = function() {
@ -566,6 +575,15 @@ $(function() {
callViewModels(allViewModels, "onBrowserTabVisibilityChange", [status]);
});
$(window).on("hashchange", function() {
changeTab();
});
if (window.location.hash != "")
{
changeTab();
}
log.info("Application startup complete");
};