diff --git a/src/sunstone/public/app/tabs/files-tab/form-panels/create.js b/src/sunstone/public/app/tabs/files-tab/form-panels/create.js index b63aa98619..702117d8d8 100644 --- a/src/sunstone/public/app/tabs/files-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/files-tab/form-panels/create.js @@ -168,6 +168,7 @@ define(function(require) { var ds_id = $('#file_datastore .resource_list_select', context).val(); if (!ds_id) { + Sunstone.hideFormPanelLoading(TAB_ID); Notifier.notifyError(Locale.tr("Please select a datastore for this file")); return false; } @@ -203,6 +204,12 @@ define(function(require) { //this is an image upload we trigger FileUploader //to start the upload if (upload) { + if (that.uploader.files.length == 0) { + Sunstone.hideFormPanelLoading(TAB_ID); + Notifier.notifyError(Locale.tr("Please select a file to upload")); + return false; + } + Sunstone.resetFormPanel(that.tabId, that.formPanelId); Sunstone.hideFormPanel(that.tabId); diff --git a/src/sunstone/public/app/tabs/images-tab/form-panels/create.js b/src/sunstone/public/app/tabs/images-tab/form-panels/create.js index ec61d14d19..8ccd5bfd87 100644 --- a/src/sunstone/public/app/tabs/images-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/images-tab/form-panels/create.js @@ -192,6 +192,7 @@ define(function(require) { var ds_id = $('#img_datastore .resource_list_select', context).val(); if (!ds_id) { + Sunstone.hideFormPanelLoading(TAB_ID); Notifier.notifyError(Locale.tr("Please select a datastore for this image")); return false; } @@ -250,6 +251,12 @@ define(function(require) { //this is an image upload we trigger FileUploader //to start the upload if (upload) { + if (that.uploader.files.length == 0) { + Sunstone.hideFormPanelLoading(TAB_ID); + Notifier.notifyError(Locale.tr("Please select a file to upload")); + return false; + } + Sunstone.resetFormPanel(that.tabId, that.formPanelId); Sunstone.hideFormPanel(that.tabId);