From 17adeda45d99976cc0b7acecf80a4f147efcdc1f Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Sat, 5 Oct 2013 06:00:44 +0200 Subject: [PATCH] the resources_selected plugin always starts up toggled off, then any action (adding, deleting) makes it toggle on --- manifold/static/js/plugin.js | 10 ++++++++++ .../resources_selected/static/js/resources_selected.js | 7 ++++++- portal/sliceview.py | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/manifold/static/js/plugin.js b/manifold/static/js/plugin.js index 07ba9b71..cb20be4f 100644 --- a/manifold/static/js/plugin.js +++ b/manifold/static/js/plugin.js @@ -248,6 +248,16 @@ var Plugin = Class.extend({ return array[arguments.length + 1]; }, + // TOGGLE + // plugin-helper.js is about managing toggled state + // it would be beneficial to merge it in here + toggle_on: function () { return this.toggle("true"); }, + toggle_off: function () { return this.toggle("false"); }, + toggle: function (status) { + messages.debug("toggle domid="+this.options.plugin_uuid); + plugin_helper.set_toggle_status (this.options.plugin_uuid,status); + }, + /* SPIN */ spin: function() { diff --git a/plugins/resources_selected/static/js/resources_selected.js b/plugins/resources_selected/static/js/resources_selected.js index 175fef46..a7842888 100644 --- a/plugins/resources_selected/static/js/resources_selected.js +++ b/plugins/resources_selected/static/js/resources_selected.js @@ -120,7 +120,12 @@ var button = ''; var row; - + + // make sure the change is visible : toggle on the whole plugin + // this might hae to be made an 'auto-toggle' option of this plugin.. + // also it might be needed to be a little finer-grained here + this.toggle_on(); + switch(data.request) { case FIELD_REQUEST_ADD_RESET: case FIELD_REQUEST_REMOVE_RESET: diff --git a/portal/sliceview.py b/portal/sliceview.py index 8ccc6f49..fe95764c 100644 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@ -106,6 +106,8 @@ class SliceView (LoginRequiredAutoLogoutView): title = 'Pending operations', query = main_query, togglable = True, + # start turned off, it will open up itself when stuff comes in + toggled = False, domid = 'pending', outline_complete = True, )) -- 2.43.0