mirror of
https://github.com/NaN-tic/sao-base.git
synced 2023-12-14 03:13:01 +01:00
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:
parent
e0b76ceabe
commit
c16ad30dba
1 changed files with 8 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue