Created
October 15, 2018 16:57
-
-
Save elbotho/55b16e399758985ccf466cbafed5f551 to your computer and use it in GitHub Desktop.
Squarespace search umlauts hack
This file contains 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
//until the bug gets fixed this kinda works | |
document.addEventListener("DOMContentLoaded", function() { | |
setTimeout(setupSearchFix, 1200); | |
}); | |
function setupSearchFix(){ | |
var if( $('.sqs-search-page .sqs-search-page-input input').length === 0 ) return; | |
console.log('squarespace search-fix'); | |
var searchInput = Y.Widget.getByNode( Y.one ('.sqs-search-page .sqs-search-page-input input') ); | |
var str = searchInput.get('queryString'); | |
if ( !/[\-_.\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/i.test(str) ) return; //no umlauts to fix | |
searchInput.set('queryString', str+' ' ); | |
searchInput.set('queryString', str.substring(0,str.length) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment