Skip to content

Commit 5024835

Browse files
committed
Bugfix for deactivate old page on push view
1 parent 39f2518 commit 5024835

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,4 @@ setTimeout(function(){
250250

251251
## Licence
252252

253-
Released under MIT License (MIT) Copyright (c) 2014-2016 Matteo Baggio & Michele Belluco
253+
Released under MIT License (MIT) Copyright (c) 2014-2018 Matteo Baggio & Michele Belluco

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backbone.viewstack",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"homepage": "https://github.com/vash15/backbone.viewstack",
55
"authors": [
66
"Michele Belluco <michele@belluco.info>",

lib/viewstack.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,18 @@
169169
return this;
170170
}
171171

172-
options = _.defaults(options || {}, {
172+
var OPTIONS_DEFAULT = {
173173
animatePreviousView: true,
174174
render: true
175-
});
175+
};
176+
options = _.defaults(options || {}, OPTIONS_DEFAULT);
176177

177178
if ( this._current === newView )
178179
return this;
179180

180-
var oldActiveView = this._current;
181-
var zIndex = this.getZIndex();
181+
var oldActiveView = this._current;
182+
var oldActiveViewOptions = _.defaults((this.getActiveViewWithOptions()||{}).options || {}, OPTIONS_DEFAULT);
183+
var zIndex = this.getZIndex();
182184

183185
if ( newView.setZindex )
184186
newView.setZindex( zIndex );
@@ -232,7 +234,7 @@
232234

233235
// Hook:Deactive old active view
234236
if ( options.animatePreviousView === true ) {
235-
this._hookDeactive( oldActiveView, options.animated );
237+
this._hookDeactive( oldActiveView, oldActiveViewOptions.animated );
236238
} else {
237239
if (oldActiveView.onDeactivate)
238240
oldActiveView.onDeactivate();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backbone.viewstack",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "View stack for Backbone",
55
"main": "lib/viewstack.js",
66
"repository": {

0 commit comments

Comments
 (0)