aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/lib/RecipeWebview.js
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2020-03-09 19:30:19 +0100
committerLibravatar GitHub <noreply@github.com>2020-03-09 19:30:19 +0100
commit5a2b3f0c03d20048ca372d630af6ef06ab9838b4 (patch)
tree89c275f35d8c749582d6c174e74a076408f59608 /src/webview/lib/RecipeWebview.js
parentAdd "Find in Page" feature (#446) (diff)
downloadferdium-app-5a2b3f0c03d20048ca372d630af6ef06ab9838b4.tar.gz
ferdium-app-5a2b3f0c03d20048ca372d630af6ef06ab9838b4.tar.zst
ferdium-app-5a2b3f0c03d20048ca372d630af6ef06ab9838b4.zip
Add custom dark mode handler support (#445)
* Add custom dark mode handler support * Fix lint
Diffstat (limited to 'src/webview/lib/RecipeWebview.js')
-rw-r--r--src/webview/lib/RecipeWebview.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/webview/lib/RecipeWebview.js b/src/webview/lib/RecipeWebview.js
index 1d24326c5..4fac21c55 100644
--- a/src/webview/lib/RecipeWebview.js
+++ b/src/webview/lib/RecipeWebview.js
@@ -19,6 +19,8 @@ class RecipeWebview {
19 19
20 loopFunc = () => null; 20 loopFunc = () => null;
21 21
22 darkModeHandler = false;
23
22 /** 24 /**
23 * Initialize the loop 25 * Initialize the loop
24 * 26 *
@@ -80,6 +82,15 @@ class RecipeWebview {
80 }); 82 });
81 } 83 }
82 84
85 /**
86 * Set a custom handler for turning on and off dark mode
87 *
88 * @param {function} handler
89 */
90 handleDarkMode(handler) {
91 this.darkModeHandler = handler;
92 }
93
83 onNotify(fn) { 94 onNotify(fn) {
84 if (typeof fn === 'function') { 95 if (typeof fn === 'function') {
85 window.Notification.prototype.onNotify = fn; 96 window.Notification.prototype.onNotify = fn;