From 9b44a38cd29e9b8da11f8cb8b6d1b8660f8358cf Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Dec 2012 10:30:45 +0530 Subject: [PATCH] page refresh title issue fixed --- public/css/legacy/body.css | 9 --------- public/js/wn/router.js | 15 +++++++++++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/public/css/legacy/body.css b/public/css/legacy/body.css index 53999f1839..366e0703d9 100644 --- a/public/css/legacy/body.css +++ b/public/css/legacy/body.css @@ -118,15 +118,6 @@ div.loading_div { border: 1px solid #FF4; } -div.std-footer { - margin: 13px -15px; - border-top: 1px solid #AAA; - padding: 13px; -} - -div.std-footer-item { - margin: 0px 13px 13px 0px; -} .shadow { -moz-box-shadow: 0px 2px 2px #888; diff --git a/public/js/wn/router.js b/public/js/wn/router.js index 2fdac8e4b3..77f9496c92 100644 --- a/public/js/wn/router.js +++ b/public/js/wn/router.js @@ -1,9 +1,9 @@ // route urls to their virtual pages // re-route map (for rename) -wn.re_route = { - -} +wn.re_route = {}; +wn.route_titles = {}; + wn.route = function() { if(wn.re_route[window.location.hash]) { // after saving a doc, for example, @@ -45,6 +45,10 @@ wn.route = function() { default: wn.views.pageview.show(route[0]); } + + if(wn.route_titles[window.location.hash]) { + document.title = wn.route_titles[window.location.hash]; + } } wn.get_route = function(route) { @@ -78,7 +82,10 @@ wn.set_route = function() { wn._cur_route = null; $(window).bind('hashchange', function() { - if(location.hash==wn._cur_route) + // save the title + wn.route_titles[wn._cur_route] = document.title; + + if(window.location.hash==wn._cur_route) return; wn.route(); }); \ No newline at end of file