From cd521f97a70aa8462e767b1361055b4d3e1cbb3b Mon Sep 17 00:00:00 2001 From: Michele Belluco Date: Wed, 3 Dec 2014 15:19:44 +0100 Subject: [PATCH] Bug fix refresh url --- bower.json | 2 +- lib/viewstack.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 9f8e666..9b3bd50 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "backbone.viewstack", - "version": "1.0.5", + "version": "1.0.6", "homepage": "https://github.com/vash15/backbone.viewstack", "authors": [ "Michele Belluco ", diff --git a/lib/viewstack.js b/lib/viewstack.js index d20204e..490bd32 100644 --- a/lib/viewstack.js +++ b/lib/viewstack.js @@ -160,7 +160,7 @@ var ViewStack = module.exports = Backbone.View.extend({ refreshUrl: function refreshUrl(url) { var context = this._context; - if ( context && typeof url !== "undefined" ) { + if (!url) { var stack = this._stack; var aChunck; url = []; @@ -170,9 +170,11 @@ var ViewStack = module.exports = Backbone.View.extend({ url.push(aChunck); }); url = url.join('/'); - context.page.navigate(url, { trigger: false }); } + if ( context && typeof url == "string" ) + context.page.navigate(url, { trigger: false }); + return this; },