[PATCH] Remove button "Cancel" from modal dialog

Only one of the modal dialogs in Kimchi has a "Cancel" button along with the form submit button. That button layout is inconsistent with the rest of the application and it provides the same functionality as the "X" button present at the top of every dialog. Remove the button "Cancel" from the dialog "Edit template". Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com> --- ui/js/src/kimchi.template_edit_main.js | 4 ---- ui/pages/template-edit.html.tmpl | 1 - 2 files changed, 5 deletions(-) diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js index f0f4718..9ff8bcc 100644 --- a/ui/js/src/kimchi.template_edit_main.js +++ b/ui/js/src/kimchi.template_edit_main.js @@ -104,10 +104,6 @@ kimchi.template_edit_main = function() { }); }); - $('#tmpl-edit-button-cancel').on('click', function() { - kimchi.window.close(); - }); - $('#template-edit-storagePool').change(function() { storagepool = $(this).val(); var storageArray = storagepool.split("/"); diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl index 434d938..8a4f0e4 100644 --- a/ui/pages/template-edit.html.tmpl +++ b/ui/pages/template-edit.html.tmpl @@ -141,7 +141,6 @@ </div> <footer> <div class="btn-group"> - <a id="tmpl-edit-button-cancel" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Cancel")</span></a> <a id="tmpl-edit-button-save" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Save")</span></a> </div> </footer> -- 1.9.0

Only one of the modal dialogs in Kimchi has a "Cancel" button along with the form submit button. That button layout is inconsistent with the rest of the application and it provides the same functionality as the "X" button present at the top of every dialog.
Remove the button "Cancel" from the dialog "Edit template". Good point to keep consistent! And be aware of that the confirmation
On 05/15/2014 04:40 AM, Crístian Viana wrote: dialog still has "Cancel" Button with "X" button at the right top corner. For that case, seems putting "OK" and "Cancel" Buttons at the same line is a good choice. I'll send a patch for confirmation dialog to remove "X" button.
Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
Reviewed-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
--- ui/js/src/kimchi.template_edit_main.js | 4 ---- ui/pages/template-edit.html.tmpl | 1 - 2 files changed, 5 deletions(-)
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js index f0f4718..9ff8bcc 100644 --- a/ui/js/src/kimchi.template_edit_main.js +++ b/ui/js/src/kimchi.template_edit_main.js @@ -104,10 +104,6 @@ kimchi.template_edit_main = function() { }); });
- $('#tmpl-edit-button-cancel').on('click', function() { - kimchi.window.close(); - }); - $('#template-edit-storagePool').change(function() { storagepool = $(this).val(); var storageArray = storagepool.split("/"); diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl index 434d938..8a4f0e4 100644 --- a/ui/pages/template-edit.html.tmpl +++ b/ui/pages/template-edit.html.tmpl @@ -141,7 +141,6 @@ </div> <footer> <div class="btn-group"> - <a id="tmpl-edit-button-cancel" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Cancel")</span></a> <a id="tmpl-edit-button-save" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Save")</span></a> </div> </footer>

Good point to keep consistent! And be aware of that the confirmation dialog still has "Cancel" Button with "X" button at the right top corner. For that case, seems putting "OK" and "Cancel" Buttons at the same line is a good choice. I'll send a patch for confirmation dialog to remove "X" button. Thanks for the suggestion! This patch is only meant to update the modal
On 15-05-2014 00:12, Hongliang Wang wrote: dialogs (create, edit, etc), not the confirmation dialogs. I'm planning on sending a different patchset to keep the messages and buttons on the confirmation dialogs consistent as well. Some confirmation popups have "Confirm" / "Cancel", some have "OK" / "Cancel"; some popups don't even have a question (e.g. "This operation can damage your VM. OK / Cancel"). And I agree that the buttons "OK" and "Cancel" look good on the confirmation dialogs, and we should keep them there - well, they could also look nice on the modal dialogs as long as every dialog had them consistently. I'm looking forward to review your patch which will remove the "X" button from the confirmation dialogs :-)

Reviewed-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> Tested-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com> On 05/15/2014 04:40 AM, Crístian Viana wrote:
Only one of the modal dialogs in Kimchi has a "Cancel" button along with the form submit button. That button layout is inconsistent with the rest of the application and it provides the same functionality as the "X" button present at the top of every dialog.
Remove the button "Cancel" from the dialog "Edit template".
Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com> --- ui/js/src/kimchi.template_edit_main.js | 4 ---- ui/pages/template-edit.html.tmpl | 1 - 2 files changed, 5 deletions(-)
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js index f0f4718..9ff8bcc 100644 --- a/ui/js/src/kimchi.template_edit_main.js +++ b/ui/js/src/kimchi.template_edit_main.js @@ -104,10 +104,6 @@ kimchi.template_edit_main = function() { }); });
- $('#tmpl-edit-button-cancel').on('click', function() { - kimchi.window.close(); - }); - $('#template-edit-storagePool').change(function() { storagepool = $(this).val(); var storageArray = storagepool.split("/"); diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl index 434d938..8a4f0e4 100644 --- a/ui/pages/template-edit.html.tmpl +++ b/ui/pages/template-edit.html.tmpl @@ -141,7 +141,6 @@ </div> <footer> <div class="btn-group"> - <a id="tmpl-edit-button-cancel" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Cancel")</span></a> <a id="tmpl-edit-button-save" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Save")</span></a> </div> </footer>
-- Thanks and best regards! Sheldon Feng(冯少合)<shaohef@linux.vnet.ibm.com> IBM Linux Technology Center
participants (4)
-
Aline Manera
-
Crístian Viana
-
Hongliang Wang
-
Sheldon