From edd8f7996e8cd3ef2aeb1c2a9c0b1402440f3d3a Mon Sep 17 00:00:00 2001 From: jlukic Date: Thu, 4 Jun 2015 13:46:08 -0400 Subject: [PATCH] Make input autofocus faster --- src/definitions/modules/modal.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 6bc0092c7..472166653 100644 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -557,13 +557,15 @@ $.fn.modal = function(parameters) { autofocus: function() { if(settings.autofocus) { var - $inputs = $module.find(':input:visible'), + $inputs = $module.filter(':input').filter(':visible'), $autofocus = $inputs.filter('[autofocus]'), $input = ($autofocus.length > 0) - ? $autofocus - : $inputs + ? $autofocus.first() + : $inputs.first() ; - $input.first().focus(); + if($input.length > 0) { + $input.focus(); + } } }, clickaway: function() { @@ -832,7 +834,6 @@ $.fn.modal.settings = { queue : false, duration : 500, - easing : 'easeOutExpo', offset : 0, transition : 'scale',