Skip to content

Commit

Permalink
Merge pull request #1059 from OnsenUI/fix-963
Browse files Browse the repository at this point in the history
fix(ons-tabbar): Fix broken "postchange" trigger. Closes #963.
  • Loading branch information
argelius committed Nov 24, 2015
2 parents 190ef34 + e2ed6e6 commit 3b58693
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions core/elements/ons-tabbar.es6
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,19 @@ limitations under the License.

var needLoad = !selectedTab.isLoaded() && !options.keepPage;

util.arrayFrom(this._getTabbarElement().children).forEach((tab) => {
if (tab != selectedTab) {
tab.setInactive();
} else {
if (!needLoad) {
util.triggerElementEvent(this, 'postchange', {
index: index,
tabItem: selectedTab
});
}
}
});

if (needLoad) {
var removeElement = true;

Expand Down Expand Up @@ -353,19 +366,6 @@ limitations under the License.
}
}

util.arrayFrom(this._getTabbarElement().children).forEach((tab) => {
if (tab != selectedTab) {
tab.setInactive();
} else {
if (!needLoad) {
util.triggerElementEvent(this, 'postchange', {
index: index,
tabItem: selectedTab
});
}
}
});

return true;
}

Expand Down

0 comments on commit 3b58693

Please sign in to comment.