Skip to content

Commit

Permalink
Merge pull request #953 from OnsenUI/tabbar-fix
Browse files Browse the repository at this point in the history
fix(ons-tabbar): closes #948
  • Loading branch information
argelius committed Oct 21, 2015
2 parents 08fa09e + 941b74c commit e0ffade
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ v2.0.0-alpha.5
* ons-toolbar: Added "material" modifier.
* ons-back-button: Change style when parent toolbar has modifier "material".
* ons-list: Added "material" modifier.
* ons-tabbar: Fixed [#929](https://github.com/OnsenUI/OnsenUI/issues/948)
* dependencies: Fixed [#936](https://github.com/OnsenUI/OnsenUI/issues/936).
* ons-splitter: Fixed [#952](https://github.com/OnsenUI/OnsenUI/issues/952).
* ons-lazy-repeat: Fixed [#966](https://github.com/OnsenUI/OnsenUI/issues/966).
Expand Down
6 changes: 4 additions & 2 deletions framework/views/tabbarView.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ limitations under the License.
this._element = element;
this._attrs = attrs;
this._lastPageElement = null;
this._lastPageScope = null;

this._scope.$on('$destroy', this._destroy.bind(this));

Expand Down Expand Up @@ -68,11 +69,12 @@ limitations under the License.

_onPrechange: function(event) {
this._lastPageElement = this._element[0]._getCurrentPageElement();
this._lastPageScope = angular.element(this._lastPageElement).scope();
},

_onPostchange: function(event) {
if (this._lastPageElement && !this._lastPageElement.parentNode) {
angular.element(this._lastPageElement).scope().$destroy();
if (this._lastPageElement && !this._lastPageElement.parentNode && this._lastPageScope) {
this._lastPageScope.$destroy();
}
},

Expand Down

0 comments on commit e0ffade

Please sign in to comment.