From aa02129b71e09b8d41f45583197e8e8de40ca513 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 3 May 2015 11:14:26 +0300 Subject: client: load new doc button: use ajax return to the good ol days of SPA updates title name too. Double the logic - title set by the server too for a better client side behaviour. Could fix by using a template for the function setting the title, doesn't seem worth it right now. --- src/client/rz_core.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/client/rz_core.js') diff --git a/src/client/rz_core.js b/src/client/rz_core.js index e0ec1356..4b5099c9 100644 --- a/src/client/rz_core.js +++ b/src/client/rz_core.js @@ -255,6 +255,12 @@ function load_from_json(result) { update_view__graph(true); } +function set_title(rzdoc_name) +{ + // [!] needs to be synced with server provided title (index.html). double the code, half the latency. + document.title = rzdoc_name + ' -- Rhizi Prototype'; +} + /** * open rzdoc: * - set rz_config.rzdoc_cur__name @@ -266,6 +272,7 @@ function rzdoc__open(rzdoc_name) { main_graph.clear(); edit_graph.clear(); main_graph.load_from_backend(); + set_title(rzdoc_name); var rzdoc_bar = $('#rzdoc-bar_doc-label'); var rzdoc_bar__doc_lable = $('#rzdoc-bar_doc-label'); -- cgit v1.3.1