diff --git a/src/sunstone/public/app/tabs/secgroups-tab/dialogs/clone.js b/src/sunstone/public/app/tabs/secgroups-tab/dialogs/clone.js
index 0b9b85abed..ea42cae9b9 100644
--- a/src/sunstone/public/app/tabs/secgroups-tab/dialogs/clone.js
+++ b/src/sunstone/public/app/tabs/secgroups-tab/dialogs/clone.js
@@ -65,14 +65,14 @@ define(function(require) {
function _setup(context) {
var that = this;
- context.foundation('abide', 'reflow');
- context.off('invalid.fndtn.abide', '#' + DIALOG_ID + 'Form');
- context.off('valid.fndtn.abide', '#' + DIALOG_ID + 'Form');
-
- context.on('invalid.fndtn.abide', '#' + DIALOG_ID + 'Form', function(e) {
- Notifier.notifyError(Locale.tr("One or more required fields are missing or malformed."));
- }).on('valid.fndtn.abide', '#' + DIALOG_ID + 'Form', function(e) {
- var name = $('input', this).val();
+ Foundation.reflow(context, 'abide');
+ $('#' + DIALOG_ID + 'Form', context)
+ .on('forminvalid.zf.abide', function(ev, frm) {
+ Notifier.notifyError(Locale.tr("One or more required fields are missing or malformed."));
+ Sunstone.hideFormPanelLoading(that.tabId);
+ })
+ .on('formvalid.zf.abide', function(ev, frm) {
+ var name = $('input', frm).val();
var sel_elems = Sunstone.getDataTable(TAB_ID).elements();
if (sel_elems.length > 1){
@@ -84,9 +84,10 @@ define(function(require) {
} else {
Sunstone.runAction('SecurityGroup.clone',sel_elems[0],name);
}
-
- return false;
- });
+ })
+ .on("submit", function(ev) {
+ ev.preventDefault();
+ });
return false;
}
diff --git a/src/sunstone/public/app/tabs/secgroups-tab/dialogs/clone/html.hbs b/src/sunstone/public/app/tabs/secgroups-tab/dialogs/clone/html.hbs
index 8de4f0b02e..db61b8c734 100644
--- a/src/sunstone/public/app/tabs/secgroups-tab/dialogs/clone/html.hbs
+++ b/src/sunstone/public/app/tabs/secgroups-tab/dialogs/clone/html.hbs
@@ -14,7 +14,7 @@
{{! limitations under the License. }}
{{! -------------------------------------------------------------------------- }}
-
+
@@ -40,6 +40,8 @@
{{tr "Clone"}}
-
×
+
diff --git a/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create.js b/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create.js
index bf9b87c403..193c86bd5e 100644
--- a/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create.js
+++ b/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create.js
@@ -104,7 +104,6 @@ define(function(require) {
function _setup(context) {
var that = this;
- context.foundation('abide', 'reflow');
context.off("change", '.security_group_rule_protocol');
context.on("change", '.security_group_rule_protocol', function(){
@@ -167,73 +166,76 @@ define(function(require) {
}
});
- $('#rules_form_wizard',context).off('invalid.fndtn.abide');
- $('#rules_form_wizard',context).off('valid.fndtn.abide');
+ //Foundation.reflow($('#rules_form_wizard',context), 'abide');
+ $('#rules_form_wizard',context)
+ .on('forminvalid.zf.abide', function(ev, frm) {
+ Notifier.notifyError(Locale.tr("One or more required fields are missing or malformed."));
+ })
+ .on('formvalid.zf.abide', function(ev, frm) {
+ var rule = {};
+ rule["PROTOCOL"] = $(".security_group_rule_protocol", context).val();
+ rule["RULE_TYPE"] = $(".security_group_rule_type", context).val();
- $('#rules_form_wizard',context).on('invalid.fndtn.abide', function () {
-
- }).on('valid.fndtn.abide', function() {
- var rule = {};
-
- rule["PROTOCOL"] = $(".security_group_rule_protocol", context).val();
- rule["RULE_TYPE"] = $(".security_group_rule_type", context).val();
-
- switch ($('.security_group_rule_range_sel', context).val()) {
- case "ALL":
- break;
- case "RANGE":
- rule["RANGE"] = $(".security_group_rule_range input", context).val();
- break;
- }
-
- switch ($('.security_group_rule_network_sel', context).val()) {
- case "ANY":
- break;
- case "NETWORK":
- rule["IP"] = $('#security_group_rule_first_ip', context).val();
- rule["SIZE"] = $('#security_group_rule_size', context).val();
- break;
- case "VNET":
- rule["NETWORK_ID"] = that.vnetsTable.retrieveResourceTableSelect();
- break;
- }
-
- if (rule["PROTOCOL"] == "ICMP" ){
- var icmp_type_val = $(".security_group_rule_icmp_type", context).val();
-
- if (icmp_type_val != ""){
- rule["ICMP_TYPE"] = icmp_type_val;
+ switch ($('.security_group_rule_range_sel', context).val()) {
+ case "ALL":
+ break;
+ case "RANGE":
+ rule["RANGE"] = $(".security_group_rule_range input", context).val();
+ break;
}
- }
- var text = Utils.sgRuleToSt(rule);
+ switch ($('.security_group_rule_network_sel', context).val()) {
+ case "ANY":
+ break;
+ case "NETWORK":
+ rule["IP"] = $('#security_group_rule_first_ip', context).val();
+ rule["SIZE"] = $('#security_group_rule_size', context).val();
+ break;
+ case "VNET":
+ rule["NETWORK_ID"] = that.vnetsTable.retrieveResourceTableSelect();
+ break;
+ }
- $(".security_group_rules tbody", context).append(
- '\
- | '+text.PROTOCOL+' | \
- '+text.RULE_TYPE+' | \
- '+text.RANGE+' | \
- '+text.NETWORK+' | \
- '+text.ICMP_TYPE+' | \
- \
- \
- | \
-
');
+ if (rule["PROTOCOL"] == "ICMP" ){
+ var icmp_type_val = $(".security_group_rule_icmp_type", context).val();
- // Add data to tr element
- $(".security_group_rules tbody", context).children("tr").last().data("rule", rule);
+ if (icmp_type_val != ""){
+ rule["ICMP_TYPE"] = icmp_type_val;
+ }
+ }
- // Reset new rule fields
- $('#new_rule_wizard select option', context).prop('selected', function() {
- return this.defaultSelected;
+ var text = Utils.sgRuleToSt(rule);
+
+ $(".security_group_rules tbody", context).append(
+ '\
+ | '+text.PROTOCOL+' | \
+ '+text.RULE_TYPE+' | \
+ '+text.RANGE+' | \
+ '+text.NETWORK+' | \
+ '+text.ICMP_TYPE+' | \
+ \
+ \
+ | \
+
');
+
+ // Add data to tr element
+ $(".security_group_rules tbody", context).children("tr").last().data("rule", rule);
+
+ // Reset new rule fields
+ $('#new_rule_wizard select option', context).prop('selected', function() {
+ return this.defaultSelected;
+ });
+
+ $('#new_rule_wizard select', context).trigger("change");
+
+ $('#new_rule_wizard input', context).val("");
+
+ that.vnetsTable.resetResourceTableSelect();
+ })
+ .on("submit", function(ev) {
+ ev.preventDefault();
});
- $('#new_rule_wizard select', context).trigger("change");
-
- $('#new_rule_wizard input', context).val("");
-
- that.vnetsTable.resetResourceTableSelect();
- });
context.off("click", ".security_group_rules i.remove-tab");
context.on("click", ".security_group_rules i.remove-tab", function(){
@@ -241,8 +243,6 @@ define(function(require) {
tr.remove();
});
- context.foundation();
-
this.vnetsTable.initialize();
Tips.setup();