From e2a1dde3051c6240d72e5a44c4d3fbdbfa5d42c4 Mon Sep 17 00:00:00 2001 From: Matteo Baggio Date: Mon, 31 Oct 2016 09:23:45 +0100 Subject: [PATCH] Added onDeactivate even if animatePreviousView === false --- lib/viewstack.js | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/viewstack.js b/lib/viewstack.js index 2ced797..3b688a5 100644 --- a/lib/viewstack.js +++ b/lib/viewstack.js @@ -226,8 +226,12 @@ // Hook:Deactive old active view - if ( options.animatePreviousView === true ) + if ( options.animatePreviousView === true ) { this._hookDeactive( oldActiveView, options.animated ); + } else { + if (oldActiveView.onDeactivate) + oldActiveView.onDeactivate(); + } // Hook: Active new view this._hookActivate( newView, options.animated, true ); diff --git a/package.json b/package.json index b3f7cd2..72e3101 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "backbone.viewstack", - "version": "2.1.2", + "version": "2.2.0", "description": "View stack for Backbone", "main": "lib/viewstack.js", "repository": {