Last active
December 24, 2015 02:49
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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