Prevent submit of UniqueDialog
- trigger the first primary button on submit - put the focus on the first input/select issue5520 review16191002
This commit is contained in:
1 parent
8d2ce21998
commit
41708e5f17
1 file changed
+8
@@ -2579,8 +2579,16 @@
|
||||
var prm = jQuery.Deferred();
|
||||
args.push(prm);
|
||||
var dialog = this.build_dialog.apply(this, args);
|
||||
dialog.content.submit(function(evt) {
|
||||
dialog.footer.find('button.btn-primary').first().click();
|
||||
evt.preventDefault();
|
||||
}.bind(this));
|
||||
this.running = true;
|
||||
dialog.modal.modal('show');
|
||||
dialog.modal.on('shown.bs.modal', function() {
|
||||
dialog.modal.find('input,select')
|
||||
.filter(':visible').first().focus();
|
||||
});
|
||||
return prm;
|
||||
},
|
||||
close: function(dialog) {
|
||||
|
||||
Reference in new issue
Block a user