From 9744934210b1c0d6d54678b037f766d9db00d803 Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Wed, 12 Jun 2013 18:09:38 +0530 Subject: [PATCH] Fix bug while loading page without a hash URL - When default domain was loaded without hash URL, the framework did not navigate to the default first page. Fix that. --- static/js/editor.js | 2 -- static/js/mouchak.js | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/editor.js b/static/js/editor.js index dfc04a1..5b29040 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -209,8 +209,6 @@ console.log('saved', model, response); model.set(response.page); model.id = response.page.id; - //console.log(model); - //console.log(M.pages.models); M.pagelistview.render(); }, error: function(model, xhr) { diff --git a/static/js/mouchak.js b/static/js/mouchak.js index f4abf72..4dde0d9 100644 --- a/static/js/mouchak.js +++ b/static/js/mouchak.js @@ -164,8 +164,10 @@ M.init = function() { var app_router = new AppRouter(); Backbone.history.start(); - //var startpage = M.pages.models[0].get('name'); - //app_router.navigate(startpage, {trigger: true}); + if(!location.hash) { + var startpage = M.pages.models[0].get('name'); + app_router.navigate(startpage, {trigger: true}); + } //M.simHeir(); }; -- 1.7.10.4