Skip to content

Commit

Permalink
Fix facet collapse anchor tag so a click doesn't scroll the page; fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Apr 6, 2014
1 parent 82870a7 commit 1e7b65c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/blacklight/blacklight.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//= require blacklight/bookmark_toggle
//= require blacklight/ajax_modal
//= require blacklight/search_context
//= require blacklight/collapsable
//
//Bootstrap JS for providing collapsable tablet/mobile menu/alert boxes
//= require bootstrap/transition
Expand Down
9 changes: 9 additions & 0 deletions app/assets/javascripts/blacklight/collapsable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(function($) {
Blacklight.onLoad(function() {
// when clicking on a link that toggles the collapsing behavior, don't do anything
// with the hash or the page could jump around.
$(document).on("click", "a[data-toggle=collapse][href='#'], [data-toggle=collapse] a[href='#']", function(event) {
event.preventDefault();
});
});
})(jQuery);

0 comments on commit 1e7b65c

Please sign in to comment.