Browse Source

page refresh title issue fixed

version-14
Rushabh Mehta 12 years ago
parent
commit
9b44a38cd2
2 changed files with 11 additions and 13 deletions
  1. +0
    -9
      public/css/legacy/body.css
  2. +11
    -4
      public/js/wn/router.js

+ 0
- 9
public/css/legacy/body.css View File

@@ -118,15 +118,6 @@ div.loading_div {
border: 1px solid #FF4; 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 { .shadow {
-moz-box-shadow: 0px 2px 2px #888; -moz-box-shadow: 0px 2px 2px #888;


+ 11
- 4
public/js/wn/router.js View File

@@ -1,9 +1,9 @@
// route urls to their virtual pages // route urls to their virtual pages


// re-route map (for rename) // re-route map (for rename)
wn.re_route = {
}
wn.re_route = {};
wn.route_titles = {};
wn.route = function() { wn.route = function() {
if(wn.re_route[window.location.hash]) { if(wn.re_route[window.location.hash]) {
// after saving a doc, for example, // after saving a doc, for example,
@@ -45,6 +45,10 @@ wn.route = function() {
default: default:
wn.views.pageview.show(route[0]); 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) { wn.get_route = function(route) {
@@ -78,7 +82,10 @@ wn.set_route = function() {
wn._cur_route = null; wn._cur_route = null;


$(window).bind('hashchange', function() { $(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; return;
wn.route(); wn.route();
}); });

Loading…
Cancel
Save