From 96f46970c2d37a3d64b5f918ddeae5f88c0fd6ed Mon Sep 17 00:00:00 2001 From: William Toohey Date: Mon, 8 Feb 2016 17:37:26 +1000 Subject: [PATCH] Settings window no longer affected by invert --- src/js/HuesSettings.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/js/HuesSettings.js b/src/js/HuesSettings.js index c058dee..1499498 100644 --- a/src/js/HuesSettings.js +++ b/src/js/HuesSettings.js @@ -260,6 +260,7 @@ function HuesSettings(defaults) { HuesSettings.prototype.connectCore = function(core) { this.core = core; + core.addEventListener("invert", this.onInvert.bind(this)); core.settingsUpdated(); }; @@ -305,6 +306,17 @@ HuesSettings.prototype.showInfo = function() { document.getElementById("tab-info").click(); }; +// We don't want the settings window inverted, it makes editing annoying +HuesSettings.prototype.onInvert = function(invert) { + if(invert) { + this.window.style.filter = "invert(100%)"; + this.window.style.webkitFilter = "invert(100%)"; + } else { + this.window.style.filter = ""; + this.window.style.webkitFilter = ""; + } +} + HuesSettings.prototype.initUI = function() { let doc = this.root.ownerDocument;