Skip to content

Commit

Permalink
send the original url to catalog#track, and redirect to it after we r…
Browse files Browse the repository at this point in the history
…ecord the track
  • Loading branch information
cbeer committed Mar 10, 2014
1 parent 16e479b commit 8f66873
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/assets/javascripts/blacklight/search_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
csrfToken = $('meta[name=csrf-token]').attr('content'),
csrfParam = $('meta[name=csrf-param]').attr('content'),
form = $('<form method="post" action="' + href + '"></form>'),
metadataInput = '<input name="_method" value="' + method + '" type="hidden" />';
metadataInput = '<input name="_method" value="' + method + '" type="hidden" />',
redirectHref = '<input name="redirect" value="' + link.attr('href') + '" type="hidden" />';

// check for meta keys.. if set, we should open in a new tab
if(event.metaKey || event.ctrlKey) {
Expand Down
2 changes: 1 addition & 1 deletion lib/blacklight/catalog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def show
# updates the search counter (allows the show view to paginate)
def track
search_session['counter'] = params[:counter]
redirect_to :action => "show", :status => 303
redirect_to URI.parse(params[:redirect]).path , :status => 303
end

# displays values and pagination links for a single facet field
Expand Down

0 comments on commit 8f66873

Please sign in to comment.