eventually this should be expanded to select / disable select links
  depending on which instance actions are appropriate for the current
  instance state.
---
 src/app/views/instance/index.haml |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/app/views/instance/index.haml 
b/src/app/views/instance/index.haml
index 8024a2f..949b3cf 100644
--- a/src/app/views/instance/index.haml
+++ b/src/app/views/instance/index.haml
@@ -1,3 +1,21 @@
+:javascript
+  $(document).ready(function() {
+    // toggle which action links are enabled depending on selected action
+    // TODO right now actions which are enabled / disabled are fixed, but
+    // should depend on which instance is selected
+    function toggle_actions(){
+      if($("input[name='id[]']:checked").length == "0"){
+        $("li.shutdown").addClass('disabled');
+        $("li.delete").addClass('disabled');
+      }else{
+        $("li.shutdown").removeClass('disabled');
+        $("li.delete").removeClass('disabled');
+      }
+    }
+    toggle_actions();
+    $("input[name='id[]']").click(toggle_actions);
+  });
+
 - columns = [                                                     |
   {:name => '', :sortable => false},                              |
   {:name => 'STATUS', :sortable => false},                        |
-- 
1.7.2.3

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to