From 06bb8f5589ce25cbf4b3215367105ddf6cd3fa57 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Tue, 4 Mar 2014 19:19:17 +0100 Subject: [PATCH 1/1] update pending badge --- portal/static/js/myslice-ui.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/portal/static/js/myslice-ui.js b/portal/static/js/myslice-ui.js index 0003057f..ef95e465 100644 --- a/portal/static/js/myslice-ui.js +++ b/portal/static/js/myslice-ui.js @@ -8,10 +8,20 @@ $(document).ready(function() { /* Testbeds list */ - $("div#testbed-list").ready(function() { - $("table#testbedList").load("/table/network/", { "fields" : ["network_hrn","description"], "options": ["checkbox"] }, function() { - - }); + $("table#testbedList").load("/table/network/", { "fields" : ["network_hrn","description"], "options": ["checkbox"] }, function() { + $(this).dataTable( { + "sScrollY": window.innerHeight - 275, + "sDom": "frtiS", + "bScrollCollapse": true, + "bStateSave": true, + "bPaginate": false, + "bLengthChange": false, + "bFilter": false, + "bSort": true, + "bInfo": false, + "bAutoWidth": true, + "bAutoHeight": false + } ); }); $("#objectList").load("/table/resource/", {"fields" : ["hostname","hrn","country","type"], "options": ["checkbox"] }, function(data) { @@ -32,6 +42,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(); + } } } } ); -- 2.43.0