Skip to content

Instantly share code, notes, and snippets.

@seamusjr
Last active December 24, 2015 02:49
Show Gist options
  • Save seamusjr/6733595 to your computer and use it in GitHub Desktop.
Save seamusjr/6733595 to your computer and use it in GitHub Desktop.
DW: Fix top level category search refinements when SEO friendly links are on
//In app.js to fix top level category:
// handle events for updating grid
$cache.main.on("click", ".refinements a, .pagination a, .breadcrumb-refinement-value a", function (e) {
e.preventDefault();
if ($(this).parent().hasClass("unselectable")) { return; }
if (typeof $(this).attr('href') === 'undefined' || $(this).attr('href') == '') { return; }
var uri = app.util.getUri(this);
// console.log("uri: "+JSON.stringify(uri));
if ( uri.query.length > 1 ) {
// window.location.hash = encodeURI(uri.query.substring(1));
window.location.hash = encodeURI(uri.path + uri.query);
} else {
// window.location.href = encodeURI(this.href);
window.location.hash = encodeURI(uri.path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment