Created
September 24, 2012 15:29
-
-
Save starzonmyarmz/3776534 to your computer and use it in GitHub Desktop.
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
searchField.on('keyup paste', function() { | |
// Need a delay here because the paste event registers | |
// just before the text is actually pasted which would | |
// result in the input not having a value | |
var delay = window.setTimeout(function() { | |
if (searchField.val()) { | |
searchBtn.prop("disabled", false).removeClass("ui-state-disabled"); | |
} else { | |
searchBtn.prop("disabled", true).addClass("ui-state-disabled"); | |
} | |
window.clearTimeout(delay); | |
}, 25); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment