Created
December 6, 2012 19:39
-
-
Save meandavejustice/4227623 to your computer and use it in GitHub Desktop.
.blur is catching .js-search-clear before it gets to $document
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
$document.on('click', '.js-search-close', function(e) { | |
e.preventDefault(); | |
$('#navigation-global-search, #datepicker').val(''); // clear form value | |
Backbone.history.navigate(lastFragmentBeforeSearch || '', {trigger: true}); | |
}); | |
$document.on('click', 'js-search-clear', function(e) { | |
e.preventDefault(); | |
$('#navigation-global-search').val(''); //clear form value | |
}); | |
$('#navigation-global-search').focus(function() { | |
$('.js-search-clear').show();//make close appear on focus | |
}); | |
$('#navigation-global-search').blur(function() { | |
$('.js-search-clear').hide();//and disappear | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment