Revision 62ebf1c3 snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js | ||
---|---|---|
415 | 415 |
|
416 | 416 |
show_connect_vms_overlay: function() { |
417 | 417 |
this.parent_view.show_connect_vms_overlay(); |
418 |
}, |
|
419 |
|
|
420 |
check_empty: function() { |
|
421 |
views.NetworkPortCollectionView.__super__.check_empty.apply(this, arguments); |
|
422 |
if (this.collection.length == 0) { |
|
423 |
this.parent_view.set_ports_empty(); |
|
424 |
} else { |
|
425 |
this.parent_view.unset_ports_empty(); |
|
426 |
} |
|
418 | 427 |
} |
419 | 428 |
}); |
420 | 429 |
|
... | ... | |
428 | 437 |
this.ports_toggler.click(this.toggle_ports); |
429 | 438 |
this.ports_visible = false; |
430 | 439 |
}, |
440 |
|
|
441 |
set_ports_empty: function() { |
|
442 |
if (this.ports_visible) { |
|
443 |
this.toggle_ports(); |
|
444 |
} |
|
445 |
this.ports_empty = true; |
|
446 |
this.ports_toggler.find(".cont-toggler").addClass("disabled"); |
|
447 |
}, |
|
448 |
|
|
449 |
unset_ports_empty: function() { |
|
450 |
this.ports_toggler.find(".cont-toggler").removeClass("disabled"); |
|
451 |
this.ports_empty = false; |
|
452 |
}, |
|
431 | 453 |
|
432 | 454 |
toggle_ports: function(e, hide) { |
433 | 455 |
$(window).trigger("resize"); |
... | ... | |
435 | 457 |
if (hide) { |
436 | 458 |
this.ports.stop().hide(); |
437 | 459 |
} else { |
460 |
if (this.ports_empty) { return } |
|
438 | 461 |
var self = this; |
439 | 462 |
this.ports.parent().parent().css({overflow: 'hidden'}); |
440 | 463 |
this.ports.stop().slideToggle(function() { |
Also available in: Unified diff