From 27b4b540982fd5ffb38c49ed20b7d6700521e4d7 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Thu, 15 Mar 2012 21:57:50 +0000 Subject: [PATCH] [demo,bugfix][xs]: fix losing routing hash which mean we could not share urls (result of 5660c8802089193f6656ffc6552e05491c9e320a). --- demo/js/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/demo/js/app.js b/demo/js/app.js index 1cbab287..2843cf18 100755 --- a/demo/js/app.js +++ b/demo/js/app.js @@ -29,8 +29,10 @@ $(function() { // again and again function createExplorer(dataset) { // remove existing data explorer view + var reload = false; if (window.dataExplorer) { window.dataExplorer.remove(); + reload = true; } window.dataExplorer = null; var $el = $('
'); @@ -43,8 +45,10 @@ function createExplorer(dataset) { }); // HACK (a bit). Issue is that Backbone will not trigger the route // if you are already at that location so we have to make sure we genuinely switch - window.dataExplorer.router.navigate('graph'); - window.dataExplorer.router.navigate('', true); + if (reload) { + window.dataExplorer.router.navigate('graph'); + window.dataExplorer.router.navigate('', true); + } } // convenience function