Commit 23808364 authored by Sven Franck's avatar Sven Franck

app: fix reloading content of existing gadget on backlink to #home

parent bb1bd1cc
...@@ -5274,6 +5274,7 @@ ...@@ -5274,6 +5274,7 @@
skipper, base_page; skipper, base_page;
if (data) { if (data) {
// update page title on backwards transition to the first page (still // update page title on backwards transition to the first page (still
// is in DOM, so no new page created, so no title update...) // is in DOM, so no new page created, so no title update...)
// TODO: not bulletproof i18n handling... we expect i18n to be defined // TODO: not bulletproof i18n handling... we expect i18n to be defined
...@@ -5284,11 +5285,12 @@ ...@@ -5284,11 +5285,12 @@
base_page.getAttribute("data-url")) { base_page.getAttribute("data-url")) {
app.setPageTitle("global_dict.home"); app.setPageTitle("global_dict.home");
// NOTE: only once! // NOTE: this will allow going back, but only if we are not
if (base_page.getAttribute("data-set") === null) { // coming from root
if (!app.deeplink_flag) {
skipper = true; skipper = true;
app.deeplink_flag = true;
} }
base_page.setAttribute("data-set", "true");
} }
} }
...@@ -5299,17 +5301,27 @@ ...@@ -5299,17 +5301,27 @@
} else { } else {
raw_url = data.toPage; raw_url = data.toPage;
} }
} else { } else {
raw_url = window.location.href; raw_url = window.location.href;
} }
if (typeof raw_url === "string") { if (typeof raw_url === "string") {
// decode // decode
if (data && data.options.reverse) { if (data && data.options.reverse) {
raw_url = window.decodeURIComponent(raw_url); raw_url = window.decodeURIComponent(raw_url);
} }
config = app.util.parseLink(raw_url); config = app.util.parseLink(raw_url);
// NOTE: if we start from home we must prevent reloading home
// because it will be kept in the DOM
if (!config.deeplink) {
// we start from home, so we must not allow going back
// and reloading
app.deeplink_flag = true;
}
if (e) { if (e) {
page = util.getPage(raw_url.split("#").pop()); page = util.getPage(raw_url.split("#").pop());
base = page ? page.getAttribute("data-external-page") : null; base = page ? page.getAttribute("data-external-page") : null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment