Commit 92eb1f7e authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

ui: Floating ip creating progress styles

parent f0b5af3a
......@@ -5461,6 +5461,11 @@ table.list-machines .wave {
}
.create-button a.in-progress {
text-indent: -1000px;
}
.create-button a.in-progress,
.form-action.in-progress, button.in-progress {
background-image: url("../images/icons/indicators/medium/horizontal-progress.gif");
background-repeat: no-repeat;
......
......@@ -149,19 +149,37 @@
collection: storage.floating_ips,
collection_name: 'floating_ips',
model_view_cls: views.IpView,
create_view: views.IpCreateView,
create_view: undefined, // no create overlay for IPs
initialize: function() {
views.IpCollectionView.__super__.initialize.apply(this, arguments);
this.connect_view = new views.IPConnectVmOverlay();
this.creating = false;
},
set_creating: function() {
this.creating = true;
this.create_button.addClass("in-progress");
},
reset_creating: function() {
this.creating = false;
this.create_button.removeClass("in-progress");
},
handle_create_click: function() {
if (this.creating) {
return
}
this.set_creating();
network = synnefo.storage.networks.get_floating_ips_network();
this.collection.create({
floatingip: {}
},
{
complete: _.bind(function() {
this.creating = false;
this.reset_creating();
this.collection.fetch();
}, this)});
}
......
......@@ -215,7 +215,9 @@
if (this.create_view_cls) {
this._create_view = new this.create_view_cls();
}
this.$(".create-button a").click(_.bind(function(e) {
this.create_button = this.$(".create-button a");
this.create_button.click(_.bind(function(e) {
e.preventDefault();
this.handle_create_click();
}, this));
......
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