Skip to content

Commit

Permalink
Call view event onDeactivate on push a new view
Browse files Browse the repository at this point in the history
  • Loading branch information
vash15 committed Dec 2, 2014
1 parent 30d472e commit 407dc53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone.viewstack",
"version": "1.0.4",
"version": "1.0.5",
"homepage": "https://github.com/vash15/backbone.viewstack",
"authors": [
"Michele Belluco <[email protected]>",
Expand Down
11 changes: 10 additions & 1 deletion lib/viewstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ var ViewStack = module.exports = Backbone.View.extend({
newView.$el.css("z-index", zIndex);

this._stack.push( newView );

this.$el.append( newView.el );

// Lancio l'evento onDeactivate se è impostato
if ( this._current && this._current.onDeactivate )
this._current.onDeactivate();

// setto la view Corrente
this._current = newView;
//
Expand All @@ -96,6 +100,11 @@ var ViewStack = module.exports = Backbone.View.extend({
this._stack.push( newView );
// Appendo alla view dell'applicazione
this.$el.append( newView.el );

// Lancio l'evento onDeactivate se è impostato
if ( this._current && this._current.onDeactivate )
this._current.onDeactivate();

// setto la view Corrente
this._current = newView;
//
Expand Down

0 comments on commit 407dc53

Please sign in to comment.