Skip to content

Commit

Permalink
Remove autofocus polyfill
Browse files Browse the repository at this point in the history
autofocus is supported by all browsers (except mobile Safari where
focusing without interaction is not desired as it pops up a keyboard)
  • Loading branch information
jcoyne committed Aug 27, 2017
1 parent 1f93ec4 commit f6287bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 35 deletions.
16 changes: 0 additions & 16 deletions app/assets/javascripts/blacklight/autofocus.js

This file was deleted.

37 changes: 18 additions & 19 deletions app/assets/javascripts/blacklight/blacklight.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//
// These javascript files are compiled in via the Rails asset pipeline:
//= require blacklight/core
//= require blacklight/autofocus
//= require blacklight/bookmark_toggle
//= require blacklight/modal
//= require blacklight/search_context
Expand All @@ -25,32 +24,32 @@
// Twitter Typeahead for autocomplete
//= require twitter/typeahead

/* Blacklight has a Javascript setup meant to support local disabling,
modification, and use of Blacklight behaviors.
There is a global Blacklight object, available to your local JS.
Individual logic to apply JS behaviors to particular elements is
stored in functions on that Blacklight object.
The actual behaviors themselves are implemented as JQuery plugins,
/* Blacklight has a Javascript setup meant to support local disabling,
modification, and use of Blacklight behaviors.
There is a global Blacklight object, available to your local JS.
Individual logic to apply JS behaviors to particular elements is
stored in functions on that Blacklight object.
The actual behaviors themselves are implemented as JQuery plugins,
JQuery-UI widgets (a special kind of JQuery plugin), or in some cases
just as logic in the Blacklight global object.
just as logic in the Blacklight global object.
All of these things can be modified by your local JS code -- these functions
are all set up on js load, and only called on document ready, so do your
modifications just on js load, and they'll be made by the time document ready
comes along.
comes along.
Examples, in your application's own JS:
Turn off adding of behavior to facet 'more' links, using a no-op function:
Blacklight.do_more_facets_behavior = function() {};
Change the implementation of facet 'more' link behavior to use entirely
different JS.
different JS.
Blacklight.do_more_facets_behavior = function() {
$(Blacklight.do_more_facets_behavior.selector).each(function() {
//my own thing!
Expand Down

0 comments on commit f6287bf

Please sign in to comment.