mysliceMessage() js function can be used to display a message
[unfold.git] / portal / static / js / myslice-ui.js
index 0003057..5b8e7f6 100644 (file)
@@ -1,4 +1,8 @@
 
+function mysliceAlert(msg) {
+       $('#myslice-message').find('.message').text(msg);
+       $('#myslice-message').fadeIn('fast');
+}
 /* Table initialisation */
 $(document).ready(function() {
        
@@ -7,12 +11,7 @@ $(document).ready(function() {
                
        
        
-       /* Testbeds list */
-       $("div#testbed-list").ready(function() {
-               $("table#testbedList").load("/table/network/", { "fields" : ["network_hrn","description"], "options": ["checkbox"] }, function() {
-                       
-               });
-       });
+       
        
        $("#objectList").load("/table/resource/", {"fields" : ["hostname","hrn","country","type"], "options": ["checkbox"] }, function(data) {
                $(this).dataTable( {
@@ -32,6 +31,10 @@ $(document).ready(function() {
                                        var el = $('*[data-key="'+myslice.pending[i]+'"]');
                                        el.addClass("active");
                                        el.find('input[type=checkbox]').prop('checked', true);
+                                       if (myslice.count() > 0) {
+                                               $('#badge-pending').text(myslice.count());
+                                               $('#badge-pending').show();
+                                       }
                                }
                    }
                } );