Revision 1fc7640d 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 | ||
---|---|---|
68 | 68 |
this.submit_handler_set = false; |
69 | 69 |
}, |
70 | 70 |
|
71 |
handle_vm_click: function(el) { |
|
72 |
$(el).toggleClass("selected"); |
|
73 |
}, |
|
74 |
|
|
71 | 75 |
init_handlers: function() { |
72 | 76 |
var self = this; |
73 |
this.list.find("li").click(function(){ |
|
74 |
$(this).toggleClass("selected");
|
|
77 |
this.list.find("li").click(function() {
|
|
78 |
self.handle_vm_click($(this));
|
|
75 | 79 |
}); |
76 | 80 |
|
77 | 81 |
if (!this.submit_handler_set) { |
... | ... | |
138 | 142 |
}, this)); |
139 | 143 |
}, |
140 | 144 |
|
141 |
show_vms: function(network, vms, selected, callback) { |
|
145 |
show_vms: function(network, vms, selected, callback, subtitle) {
|
|
142 | 146 |
this.network = network; |
143 | 147 |
this.reset(); |
144 |
this.set_subtitle(network.escape("name")); |
|
148 |
if (network) { |
|
149 |
this.set_subtitle(network.escape("name")); |
|
150 |
} else { |
|
151 |
this.set_subtitle(subtitle); |
|
152 |
} |
|
153 |
|
|
145 | 154 |
this.vms = vms; |
146 |
if (!synnefo.config.network_allow_duplicate_vm_nics) { |
|
155 |
if (!synnefo.config.network_allow_duplicate_vm_nics && this.network) {
|
|
147 | 156 |
this.vms = _.filter(this.vms, function(vm) { |
148 | 157 |
return !vm.connected_to(this.network); |
149 | 158 |
}, this); |
Also available in: Unified diff