File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " backbone.viewstack" ,
3- "version" : " 0.0.1 " ,
3+ "version" : " 0.0.3 " ,
44 "homepage" : " https://github.com/vash15/backbone.viewstack" ,
55 "authors" : [
66 " Michele Belluco <michele@belluco.info>"
Original file line number Diff line number Diff line change @@ -121,8 +121,8 @@ var ViewStack = module.exports = BackBone.View.extend({
121121 // refresh
122122 // Aggiorna l'url se la view corrette ce l'ha settata
123123 refreshUrl : function refreshUrl ( ) {
124- var shared = this . getShared ( ) ;
125- if ( typeof shared !== "undefined" && this . _current && this . _current . url ) {
124+ var shared = this . getShared ? this . getShared ( ) : null ;
125+ if ( typeof shared !== "undefined" && shared && this . _current && this . _current . url ) {
126126 shared . app . navigate ( _ . result ( this . _current , 'url' ) ) ;
127127 }
128128 return this ;
@@ -172,7 +172,8 @@ ViewStack.middleware = function middleware(options){
172172 return function ( shared , next ) {
173173 var viewStack = new ViewStack ( options ) ;
174174 viewStack . clearStack ( ) ; // Pulisco dalle eventuali view appese
175- viewStack . setShared ( shared ) ; // setto lo shared object
175+ if ( viewStack . setShared )
176+ viewStack . setShared ( shared ) ; // setto lo shared object
176177 viewStack . render ( ) ; // Renderizzo la view base application
177178 shared . viewstack = viewStack ;
178179 next ( ) ;
You can’t perform that action at this time.
0 commit comments