the resources_selected plugin always starts up toggled off, then any action (adding...
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 5 Oct 2013 04:00:44 +0000 (06:00 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Sat, 5 Oct 2013 04:00:44 +0000 (06:00 +0200)
manifold/static/js/plugin.js
plugins/resources_selected/static/js/resources_selected.js
portal/sliceview.py

index 07ba9b7..cb20be4 100644 (file)
@@ -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() {
index 175fef4..a784288 100644 (file)
             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:
index 8ccc6f4..fe95764 100644 (file)
@@ -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,
         ))