fix showtab

This commit is contained in:
Luke Pulverenti 2016-08-17 16:10:24 -04:00
parent e51031cad8
commit f6b89286dc

View File

@ -164,13 +164,18 @@
}
ownerpage.addEventListener('viewbeforeshow', function () {
if (tabs.triggerBeforeTabChange) {
if (tabs.triggerBeforeTabChange && this.firstTabIndex == null) {
tabs.triggerBeforeTabChange();
}
});
ownerpage.addEventListener('viewshow', function () {
tabs.triggerTabChange();
if (this.firstTabIndex) {
tabs.selectedIndex(this.firstTabIndex);
this.firstTabIndex = null;
} else {
tabs.triggerTabChange();
}
});
tabs.addEventListener('beforetabchange', function (e) {
@ -195,10 +200,8 @@
var afterNavigate = function () {
document.removeEventListener('pagebeforeshow', afterNavigate);
document.removeEventListener('pageinit', afterNavigate);
if (window.location.href.toLowerCase().indexOf(url.toLowerCase()) != -1) {
this.firstTabIndex = index;
}
};
@ -208,7 +211,7 @@
afterNavigate.call(viewManager.currentView());
} else {
pageClassOn('pagebeforeshow', 'page', afterNavigate);
pageClassOn('pageinit', 'page', afterNavigate);
Dashboard.navigate(url);
}
},