Browse Source

#2737 fix improper selector for autofocus setting, move setting check to outside function so it can be called manually

pull/2743/head
jlukic 9 years ago
parent
commit
a1ca414076
1 changed files with 12 additions and 12 deletions
  1. 24
      src/definitions/modules/modal.js

24
src/definitions/modules/modal.js

@ -341,7 +341,9 @@ $.fn.modal = function(parameters) {
module.add.keyboardShortcuts();
module.save.focus();
module.set.active();
module.set.autofocus();
if(settings.autofocus) {
module.set.autofocus();
}
callback();
}
})
@ -562,17 +564,15 @@ $.fn.modal = function(parameters) {
set: {
autofocus: function() {
if(settings.autofocus) {
var
$inputs = $module.filter(':input').filter(':visible'),
$autofocus = $inputs.filter('[autofocus]'),
$input = ($autofocus.length > 0)
? $autofocus.first()
: $inputs.first()
;
if($input.length > 0) {
$input.focus();
}
var
$inputs = $module.fin(':input').filter(':visible'),
$autofocus = $inputs.filter('[autofocus]'),
$input = ($autofocus.length > 0)
? $autofocus.first()
: $inputs.first()
;
if($input.length > 0) {
$input.focus();
}
},
clickaway: function() {

Loading…
Cancel
Save