From 3ee17f8dd4f54785da4457cdc74e19dc0593d872 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 06:00:24 +0200 Subject: [PATCH] Add reload button --- resources/index.html | 1 + resources/js/index.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/index.html b/resources/index.html index 3fe0567..e297f01 100644 --- a/resources/index.html +++ b/resources/index.html @@ -21,6 +21,7 @@ +
diff --git a/resources/js/index.js b/resources/js/index.js index b5aeb05..c60f5d7 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -16,9 +16,7 @@ const icons = []; let services = []; let selectedService = null; -let homeButton; -let forwardButton; -let backButton; +let homeButton, forwardButton, backButton, reloadButton; let addButton; let emptyPage; let urlPreview; @@ -375,6 +373,9 @@ document.addEventListener('DOMContentLoaded', () => { backButton = document.getElementById('back'); backButton.addEventListener('click', () => goBack()); + reloadButton = document.getElementById('reload'); + reloadButton.addEventListener('click', () => reload()); + addButton = document.getElementById('add-button'); addButton.addEventListener('click', () => ipcRenderer.send('openServiceSettings', null)); }); @@ -627,6 +628,10 @@ function goBack() { if (view) remote.webContents.fromId(view.getWebContentsId()).goBack(); } +function reload() { + reloadService(selectedService); +} + function setContextMenu(webContents) { webContents.on('context-menu', (event, props) => { const menu = new Menu();