Signed-off-by: Morris Jobke <hey@morrisjobke.de>
jQuery.fn.keyUpDelayedOrEnter = function (callback, allowEmptyValue) {
var cb = callback;
var that = this;
- this.keyup(_.debounce(function (event) {
+
+ this.on('input', _.debounce(function (event) {
// enter is already handled in keypress
if (event.keyCode === 13) {
return;
cb(event);
}
});
-
- this.bind('paste', null, function (event) {
- if(!event.keyCode){
- if (allowEmptyValue || that.val() !== '') {
- cb(event);
- }
- }
- });
};
function updateAvatar (hidedefault) {