Commit 0dfba132 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

ui: Several ui fixes

- Order ports by id
- Deleted port subview html element when port gets disconnected in ips view
- Update pending action class in networks view
parent 30bab9c0
......@@ -429,11 +429,7 @@
},
comparator: function(m) {
try {
return parseInt(m.get('device_id'));
} catch (err) {
return 0
}
return parseInt(m.id);
}
});
......
......@@ -45,6 +45,12 @@
views.IpPortView = views.ext.ModelView.extend({
tpl: '#ip-port-view-tpl',
init: function() {
this.model.bind("remove", function() {
this.el.remove();
}, this);
},
vm_style: function() {
var cls, icon_state;
var style = "background-image: url('{0}')";
......
......@@ -322,6 +322,8 @@
},
disconnect_port: function(model, e) {
var parent = this.parent_view.parent_view.el;
parent.removeClass("subactionpending");
e && e.stopPropagation();
var network = this.model.get("network");
this.model.actions.reset_pending();
......@@ -332,6 +334,8 @@
},
set_firewall: function() {
var parent = this.parent_view.parent_view.el;
parent.removeClass("subactionpending");
var value = this.get_selected_value();
this.firewall_apply.addClass("in-progress");
var vm = this.model.get('vm');
......
......@@ -328,7 +328,7 @@
place_in_parent: function(parent, el, m, index, anim) {
var place_func, place_func_context, position_found, exists;
_.each(parent.find(".model-item"), function(el) {
_.each(parent.find(">.model-item"), function(el) {
var el = $(el);
var el_index = el.data('index');
if (!el_index || position_found) { return };
......@@ -496,7 +496,6 @@
this._unset_confirm();
}, this);
this.model.actions.bind("set-pending", function(action) {
console.log("ACTION", action);
this._set_confirm(action)
}, this);
}
......
......@@ -24,8 +24,8 @@
<h3 class="title floating-ip">
<span data-rv-text="model.floating_ip_address">IP ADDRESS</span>
</h3>
<div data-rv-if="model.port_id" class="ports nested-model-list proxy inline">
<div data-rv-if="model.port_id">
<div data-rv-if="model.port" class="ports nested-model-list proxy inline">
<div data-rv-if="model.port">
<div data-rv-show="model.port" data-rv-model-view="model.port|IpPortView"></div>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment