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 @@
skipper, base_page;
if (data) {
// update page title on backwards transition to the first page (still
// is in DOM, so no new page created, so no title update...)
// TODO: not bulletproof i18n handling... we expect i18n to be defined
......@@ -5284,11 +5285,12 @@
base_page.getAttribute("data-url")) {
app.setPageTitle("global_dict.home");
// NOTE: only once!
if (base_page.getAttribute("data-set") === null) {
// NOTE: this will allow going back, but only if we are not
// coming from root
if (!app.deeplink_flag) {
skipper = true;
app.deeplink_flag = true;
}
base_page.setAttribute("data-set", "true");
}
}
......@@ -5299,17 +5301,27 @@
} else {
raw_url = data.toPage;
}
} else {
raw_url = window.location.href;
}
if (typeof raw_url === "string") {
// decode
if (data && data.options.reverse) {
raw_url = window.decodeURIComponent(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) {
page = util.getPage(raw_url.split("#").pop());
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