Commit 99e0d766 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Fixed create view show machine button, Refs #1483

Disable button clicks until vm is added to the vms collection
parent 44daa7c7
......@@ -33,18 +33,29 @@
this.copy = this.$(".clip-copy");
this.$(".show-machine").click(_.bind(function(){
if (this.$(".show-machine").hasClass("in-progress")) {
return;
}
this.hide();
snf.ui.main.show_vm_details(storage.vms.get(this.vm_id));
}, this));
_.bindAll(this, "handle_vm_added");
storage.vms.bind("add", this.handle_vm_added);
},
handle_vm_added: function() {
this.$(".show-machine").removeClass("in-progress");
},
show_password: function() {
this.$(".show-machine").addClass("in-progress");
this.password.text(this.pass);
},
onClose: function() {
this.password.text("");
this.vm_id = undefined;
},
beforeOpen: function() {
......@@ -65,7 +76,7 @@
show: function(pass, vm_id) {
this.pass = pass;
this.vm_id = vm_id;
views.VMCreationPasswordView.__super__.show.apply(this, arguments);
this.show_password();
}
......
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