summaryrefslogtreecommitdiffstats
path: root/js/phpvirtualbox.js
diff options
context:
space:
mode:
authorimoore76 <imoore76@users.noreply.github.com>2015-09-09 08:55:24 -0400
committerimoore76 <imoore76@users.noreply.github.com>2015-09-09 08:55:24 -0400
commit148f49edf5e2c2877826e383f531a92de99e96e4 (patch)
tree89365f4399388ec19fe40f6169f89d137937ac75 /js/phpvirtualbox.js
parenta1172caa70fc60663bc0db62b643655497de3354 (diff)
parent06514eded5d1991ce67c5aa2b43428c918fe46d6 (diff)
downloadphpvirtualbox-148f49edf5e2c2877826e383f531a92de99e96e4.zip
phpvirtualbox-148f49edf5e2c2877826e383f531a92de99e96e4.tar.gz
phpvirtualbox-148f49edf5e2c2877826e383f531a92de99e96e4.tar.bz2
Merge pull request #6 from imoore76/develop
5.0-3
Diffstat (limited to 'js/phpvirtualbox.js')
-rw-r--r--js/phpvirtualbox.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/js/phpvirtualbox.js b/js/phpvirtualbox.js
index 1b7225e..f6f818a 100644
--- a/js/phpvirtualbox.js
+++ b/js/phpvirtualbox.js
@@ -1602,7 +1602,8 @@ var vboxVMActions = {
},
/* Start a single VM */
_startVM: function(vm) {
-
+
+ var reqPromise = $.Deferred();
$.when(vm,vboxAjaxRequest('machineSetState',{'vm':vm.id,'state':'powerUp'}))
// VM started and / or progress op returned
@@ -1613,10 +1614,15 @@ var vboxVMActions = {
if(vboxVMStates.isSaved(evm)) icon = 'progress_state_restore_90px.png';
else icon = 'progress_start_90px.png';
+ reqPromise.resolve();
+
vboxProgress({'progress':d.responseData.progress,'persist':d.persist}, function(){return;},
- icon, trans('Start selected virtual machines','UIActionPool'),evm.name);
+ icon, trans('Start selected virtual machines','UIActionPool'), evm.name);
+ } else {
+ reqPromise.reject();
}
});
+ return reqPromise;
},
click: function (btn) {
@@ -1689,10 +1695,11 @@ var vboxVMActions = {
// Save the fact that we started this VM
vboxVMActions.start._startedVMs[vm.id] = true;
- vboxVMActions.start._startVM(vm);
+ $.when(vboxVMActions.start._startVM(vm)).done(function() {
+ // Loop
+ runVMsToStart(vms);
+ });
- // Loop
- runVMsToStart(vms);
}));
})(vmsToStart);
@@ -3132,7 +3139,7 @@ function vboxWizard() {
function vboxToolbar(options) {
var self = this;
- this.buttons = options.buttons;
+ this.buttons = options.buttons ? options.buttons : [];
this.size = options.size ? options.size : 22;
this.addHeight = 24;
this.lastItem = null;