summaryrefslogtreecommitdiffstats
path: root/src/js/dashboard.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:50:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:50:18 +0000
commit55a5d29a66503248916f249ad2a1d8b37cde5a03 (patch)
treea3beb6a90dd3bdaaf67ecb05d42152a494aff946 /src/js/dashboard.js
parentAdding upstream version 1.55.0+dfsg. (diff)
downloadublock-origin-59fb3c3fd76fcdb30d9acb3ea43d538729eedc25.tar.xz
ublock-origin-59fb3c3fd76fcdb30d9acb3ea43d538729eedc25.zip
Adding upstream version 1.57.0+dfsg.upstream/1.57.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/js/dashboard.js')
-rw-r--r--src/js/dashboard.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/js/dashboard.js b/src/js/dashboard.js
index e82ec28..3ba16f0 100644
--- a/src/js/dashboard.js
+++ b/src/js/dashboard.js
@@ -25,7 +25,7 @@ import { dom, qs$ } from './dom.js';
/******************************************************************************/
-const discardUnsavedData = function(synchronous = false) {
+function discardUnsavedData(synchronous = false) {
const paneFrame = qs$('#iframe');
const paneWindow = paneFrame.contentWindow;
if (
@@ -66,9 +66,9 @@ const discardUnsavedData = function(synchronous = false) {
dom.on(document, 'click', onClick, true);
});
-};
+}
-const loadDashboardPanel = function(pane, first) {
+function loadDashboardPanel(pane, first) {
const tabButton = qs$(`[data-pane="${pane}"]`);
if ( tabButton === null || dom.cl.has(tabButton, 'selected') ) { return; }
const loadPane = ( ) => {
@@ -76,8 +76,12 @@ const loadDashboardPanel = function(pane, first) {
dom.cl.remove('.tabButton.selected', 'selected');
dom.cl.add(tabButton, 'selected');
tabButton.scrollIntoView();
- qs$('#iframe').contentWindow.location.replace(pane);
+ const iframe = qs$('#iframe');
+ iframe.contentWindow.location.replace(pane);
if ( pane !== 'no-dashboard.html' ) {
+ iframe.addEventListener('load', ( ) => {
+ qs$('.wikilink').href = iframe.contentWindow.wikilink || '';
+ }, { once: true });
vAPI.localStorage.setItem('dashboardLastVisitedPane', pane);
}
};
@@ -91,11 +95,11 @@ const loadDashboardPanel = function(pane, first) {
if ( status === false ) { return; }
loadPane();
});
-};
+}
-const onTabClickHandler = function(ev) {
+function onTabClickHandler(ev) {
loadDashboardPanel(dom.attr(ev.target, 'data-pane'));
-};
+}
if ( self.location.hash.slice(1) === 'no-dashboard.html' ) {
dom.cl.add(dom.body, 'noDashboard');