Created
December 3, 2016 17:12
-
-
Save rayrutjes/b2f2acec175a3c3f241925629799595c to your computer and use it in GitHub Desktop.
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
| search.addWidget({ | |
| init: function() { | |
| $('.clear-search-icon').on('click', function() { | |
| search.helper.setQuery(''); | |
| search.helper.search(); | |
| }); | |
| }, | |
| render: function(results) { | |
| var clearIcon = $('.clear-search-icon'); | |
| if(results.state.query.length === 0) { | |
| clearIcon.hide(); | |
| } else { | |
| clearIcon.show(); | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment