Skip to content

Commit

Permalink
Add autofocus.js to the javascript package
Browse files Browse the repository at this point in the history
It seems that it was overlooked in 6a61628
  • Loading branch information
jcoyne committed May 30, 2018
1 parent f7ecb3f commit b5b8ea8
Show file tree
Hide file tree
Showing 4 changed files with 344 additions and 326 deletions.
19 changes: 19 additions & 0 deletions app/assets/javascripts/blacklight/blacklight.js
Expand Up @@ -71,6 +71,25 @@ Blacklight.onLoad(function () {
});
});
});
(function ($) {
Blacklight.doSearchAutofocusFallback = function () {
if (typeof Blacklight.do_search_autofocus_fallback == 'function') {
console.warn("do_search_autofocus_fallback is deprecated. Use doSearchAutofocusFallback instead.");
return Blacklight.do_search_autofocus_fallback();
}
if (typeof Modernizer != 'undefined') {
if (Modernizr.autofocus) {
return;
}
}

$('input[autofocus]').focus();
};

Blacklight.onLoad(function () {
Blacklight.doSearchAutofocusFallback();
});
})(jQuery);
(function ($) {
//change form submit toggle to checkbox
Blacklight.doBookmarkToggleBehavior = function () {
Expand Down
1 change: 0 additions & 1 deletion app/javascript/blacklight/autofocus.js
@@ -1,4 +1,3 @@
//= require blacklight/core
(function($) {
Blacklight.doSearchAutofocusFallback = function() {
if (typeof Blacklight.do_search_autofocus_fallback == 'function') {
Expand Down

0 comments on commit b5b8ea8

Please sign in to comment.