Commit 252e4f83 by murtaugh

editor shows filename as doc title

1 parent a168f5e9
Showing with 8 additions and 0 deletions
......@@ -203,6 +203,14 @@ window.addEventListener("message", function (e) {
// console.log("editor: update_location", href);
if (href) {
editor.href(ensureLeadingSlash(href));
// Set window title to the name of the document
var show_title = href,
sp = href.lastIndexOf("/");
if (sp >= 0) {
show_title = href.substring(sp+1);
}
document.title = show_title;
}
}
window.addEventListener("hashchange", update_location);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!