update pending badge
[unfold.git] / portal / static / js / myslice-ui.js
index 2b0e0f6..4aa83ce 100644 (file)
@@ -8,6 +8,7 @@ $(document).ready(function() {
        
        
        /* Testbeds list */
+
        $.post("/rest/network/", { "fields" : ["network_hrn", "network_longname", "description"]}, function(data) {
                        var testbed_data = [];
                        var testbed_row = "<thead>";
@@ -65,6 +66,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();
+                                       }
                                }
                    }
                } );