diff options
Diffstat (limited to 'src/webview/lib/RecipeWebview.js')
-rw-r--r-- | src/webview/lib/RecipeWebview.js | 11 |
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; |