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 7d91dc9
Show file tree
Hide file tree
Showing 3 changed files with 345 additions and 325 deletions.
20 changes: 20 additions & 0 deletions app/assets/javascripts/blacklight/blacklight.js
Expand Up @@ -71,6 +71,26 @@ Blacklight.onLoad(function () {
});
});
});
//= require blacklight/core
(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

0 comments on commit 7d91dc9

Please sign in to comment.