From 2a324cd6692d8fe0e38b5aa3d8c27fdfc0d72619 Mon Sep 17 00:00:00 2001 From: Spencer Alger Date: Fri, 27 Mar 2015 14:13:21 -0700 Subject: [PATCH] restore the toggle logic in a way that actually works --- src/kibana/plugins/dashboard/index.html | 32 ++++++++++++++++--- src/kibana/plugins/discover/index.html | 22 +++++++++++-- .../plugins/visualize/editor/editor.html | 22 +++++++++++-- src/kibana/utils/config_template.js | 6 +++- 4 files changed, 71 insertions(+), 11 deletions(-) diff --git a/src/kibana/plugins/dashboard/index.html b/src/kibana/plugins/dashboard/index.html index 1630701ac03e..22664ab85055 100644 --- a/src/kibana/plugins/dashboard/index.html +++ b/src/kibana/plugins/dashboard/index.html @@ -34,16 +34,40 @@ - + - + - + - + diff --git a/src/kibana/plugins/discover/index.html b/src/kibana/plugins/discover/index.html index 8de55ea7f7aa..89bafb1a6c65 100644 --- a/src/kibana/plugins/discover/index.html +++ b/src/kibana/plugins/discover/index.html @@ -24,13 +24,29 @@ diff --git a/src/kibana/plugins/visualize/editor/editor.html b/src/kibana/plugins/visualize/editor/editor.html index 6ffca8949971..89d2c68b3cdb 100644 --- a/src/kibana/plugins/visualize/editor/editor.html +++ b/src/kibana/plugins/visualize/editor/editor.html @@ -82,13 +82,29 @@ - + - + - + diff --git a/src/kibana/utils/config_template.js b/src/kibana/utils/config_template.js index 374688356f34..eff806a981a8 100644 --- a/src/kibana/utils/config_template.js +++ b/src/kibana/utils/config_template.js @@ -10,7 +10,7 @@ define(function (require) { function update(newState, name) { var toUpdate = templates[name]; - var curState = template.current === toUpdate; + var curState = template.is(name); if (newState == null) newState = !curState; if (newState) { @@ -22,6 +22,10 @@ define(function (require) { return newState; } + template.is = function (name) { + return template.current === templates[name]; + }; + template.toString = function () { return template.current; };