Added active tab using hash from URL feature, as requested in issue #203
This commit is contained in:
parent
8a8b88af13
commit
bcb74d01b6
1 changed files with 18 additions and 0 deletions
|
|
@ -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");
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue