From 2a9060625d61a3cb157da2adb8c2a72690df8dd1 Mon Sep 17 00:00:00 2001 From: "Alex M. Sielicki" Date: Mon, 19 Jun 2017 20:06:28 +0000 Subject: [PATCH] Adding nulls toggle button to filters. Addresses #730 --- .../plugins/slycat-parameter-image/css/ui.css | 7 ++++++- .../slycat-parameter-image/js/filter-manager.js | 13 +++++++++++++ .../plugins/slycat-parameter-image/ui.html | 16 +++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/web-server/plugins/slycat-parameter-image/css/ui.css b/web-server/plugins/slycat-parameter-image/css/ui.css index 91dff3dbc..176372c88 100644 --- a/web-server/plugins/slycat-parameter-image/css/ui.css +++ b/web-server/plugins/slycat-parameter-image/css/ui.css @@ -651,7 +651,8 @@ rights in this software. .slycat-pim-filter .invert-button, .slycat-pim-filter .select-all-button, .slycat-pim-filter .select-none-button, -.slycat-pim-filter .auto-width-button +.slycat-pim-filter .auto-width-button, +.slycat-pim-filter .null-button { position: absolute; } @@ -678,6 +679,10 @@ rights in this software. left: 65px; bottom: 7px; } +.slycat-pim-filter .null-button { + bottom: 7px; + left: 7px; +} .slycat-pim-filter .minMaxHighLow .max, .slycat-pim-filter .minMaxHighLow .min, .slycat-pim-filter .minMaxHighLow .high, diff --git a/web-server/plugins/slycat-parameter-image/js/filter-manager.js b/web-server/plugins/slycat-parameter-image/js/filter-manager.js index 4fff11555..99e682458 100644 --- a/web-server/plugins/slycat-parameter-image/js/filter-manager.js +++ b/web-server/plugins/slycat-parameter-image/js/filter-manager.js @@ -102,6 +102,7 @@ define("slycat-parameter-image-filter-manager", ["slycat-server-root", "slycat-d .extend({ rateLimit: { timeout: 0, method: "notifyWhenChangesStop" } }) , autowidth: ko.observable(false), + nulls: ko.observable(false), order: ko.observable( variable_order.indexOf(index) ) }); }; @@ -121,6 +122,7 @@ define("slycat-parameter-image-filter-manager", ["slycat-server-root", "slycat-d low: low, invert: ko.observable(false), active: ko.observable(false), + nulls: ko.observable(false), order: ko.observable( variable_order.indexOf(index) ), rateLimitedHigh: ko.pureComputed(high).extend({ rateLimit: { timeout: rateLimit, method: "notifyWhenChangesStop" } }), rateLimitedLow: ko.pureComputed(low).extend({ rateLimit: { timeout: rateLimit, method: "notifyWhenChangesStop" } }), @@ -284,6 +286,17 @@ define("slycat-parameter-image-filter-manager", ["slycat-server-root", "slycat-d } self.bookmarker.updateState( {"allFilters" : mapping.toJS(vm.allFilters())} ); }; + vm.toggleNull = function(filter, event) { + if(filter.nulls()) + { + filter.nulls(false); + } + else + { + filter.nulls(true); + } + self.bookmarker.updateState( {"allFilters" : mapping.toJS(vm.allFilters())} ); + }; vm.invertFilter = function(filter, event) { if(filter.type() === 'numeric') { diff --git a/web-server/plugins/slycat-parameter-image/ui.html b/web-server/plugins/slycat-parameter-image/ui.html index 2fcd0b5a0..5dd44a45a 100644 --- a/web-server/plugins/slycat-parameter-image/ui.html +++ b/web-server/plugins/slycat-parameter-image/ui.html @@ -173,6 +173,13 @@ css: { 'fa-compress': invert(), 'fa-arrows-v': !invert() } " > + @@ -191,7 +198,7 @@ model_id: $parent.model_id "> - +