mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 11:52:37 +09:00
Feature #3748: Reset form panels when the action changes (update-create)
This commit is contained in:
1 parent
0c5c6b62ec
commit
091aad107f
7 files changed
+9
-11
No files matched your search
@@ -704,7 +704,7 @@ define(function(require) {
|
||||
formPanelInstance.insert(context);
|
||||
}
|
||||
|
||||
formPanelInstance.setAction(action);
|
||||
formPanelInstance.setAction(context, action);
|
||||
tab["activeFormPanel"] = formPanelInstance;
|
||||
|
||||
// Hide wizard/advanced selector if advanced not defined
|
||||
|
||||
@@ -68,7 +68,6 @@ define(function(require) {
|
||||
type: "single",
|
||||
call: OpenNebulaResource.show,
|
||||
callback: function(request, response) {
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "update",
|
||||
function(formPanelInstance, context) {
|
||||
formPanelInstance.fill(context, response[XML_ROOT]);
|
||||
|
||||
@@ -161,7 +161,6 @@ define(function(require) {
|
||||
}
|
||||
});
|
||||
|
||||
Sunstone.resetFormPanel(TAB_ID, FORM_PANEL_ID);
|
||||
Sunstone.hideFormPanel(TAB_ID);
|
||||
|
||||
return false;
|
||||
|
||||
@@ -53,7 +53,6 @@ define(function(require) {
|
||||
type: "single",
|
||||
call: OpenNebulaTemplate.show,
|
||||
callback: function(request, response) {
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "update",
|
||||
function(formPanelInstance, context) {
|
||||
formPanelInstance.fill(context, response[XML_ROOT])
|
||||
@@ -65,7 +64,6 @@ define(function(require) {
|
||||
type: "single",
|
||||
call: OpenNebulaTemplate.update,
|
||||
callback: function(request, response) {
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.hideFormPanel(TAB_ID);
|
||||
Notifier.notifyMessage(Locale.tr("Virtual Template updated correctly"));
|
||||
},
|
||||
|
||||
@@ -155,7 +155,6 @@ define(function(require) {
|
||||
type: "single",
|
||||
call: OpenNebulaResource.show,
|
||||
callback: function(request, response) {
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "update",
|
||||
function(formPanelInstance, context) {
|
||||
formPanelInstance.fill(context, response.VDC);
|
||||
@@ -168,7 +167,6 @@ define(function(require) {
|
||||
type: "single",
|
||||
call: OpenNebulaResource.update,
|
||||
callback: function(request, response){
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.hideFormPanel(TAB_ID);
|
||||
Notifier.notifyMessage(Locale.tr("VDC updated correctly"));
|
||||
},
|
||||
|
||||
@@ -269,7 +269,6 @@ define(function(require) {
|
||||
type: "single",
|
||||
call: OpenNebulaNetwork.show,
|
||||
callback: function(request, response) {
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "update",
|
||||
function(formPanelInstance, context) {
|
||||
formPanelInstance.fill(context, response.VNET)
|
||||
@@ -282,7 +281,6 @@ define(function(require) {
|
||||
type: "single",
|
||||
call: OpenNebulaNetwork.update,
|
||||
callback: function(request, response) {
|
||||
Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID);
|
||||
Sunstone.hideFormPanel(TAB_ID);
|
||||
Notifier.notifyMessage(Locale.tr("Virtual Network updated correctly"));
|
||||
},
|
||||
|
||||
@@ -73,8 +73,14 @@ define(function(require) {
|
||||
this.insert(context);
|
||||
}
|
||||
|
||||
function _setAction(action) {
|
||||
this.action = action
|
||||
function _setAction(context, action) {
|
||||
var prevAction = this.action;
|
||||
|
||||
this.action = action;
|
||||
|
||||
if (prevAction != action || action == "update") {
|
||||
this.reset(context);
|
||||
}
|
||||
}
|
||||
|
||||
// @return [Object] actionOptions of the form based on the defined action
|
||||
|
||||
Reference in new issue
Block a user