mirror of https://github.com/apache/cloudstack.git
Form dialog UI: Support on cancel action
If args.cancel is passed to createForm widget, call it when cancel button is
clicked.
Example:
createForm: {
cancel: function() { ... },
...
}
This commit is contained in:
parent
8e4d020cf8
commit
0ea93d6904
|
|
@ -36,6 +36,7 @@
|
|||
* Dialog with form
|
||||
*/
|
||||
createForm: function(args) {
|
||||
var cancel = args.cancel;
|
||||
var $formContainer = $('<div>').addClass('form-container');
|
||||
var $form = $('<form>').appendTo($formContainer)
|
||||
.submit(function() {
|
||||
|
|
@ -113,6 +114,10 @@
|
|||
$(this).dialog('destroy');
|
||||
|
||||
$('.hovered-elem').hide();
|
||||
|
||||
if (cancel) {
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
}]
|
||||
}).closest('.ui-dialog').overlay();
|
||||
|
|
|
|||
Loading…
Reference in New Issue