Use jQuery.one() instead of binding and unbinding a handler

(imported from commit 23b87ee500c0739b04e6fa3c89065d4af13ab9b5)
This commit is contained in:
Zev Benjamin 2012-11-26 15:31:47 -05:00
parent 369f5e9d80
commit 9de11f4df1
1 changed files with 1 additions and 2 deletions

View File

@ -125,9 +125,8 @@ function handle_keyup(e) {
// http://stackoverflow.com/questions/3380458/looking-for-a-better-workaround-to-chrome-select-on-focus-bug // http://stackoverflow.com/questions/3380458/looking-for-a-better-workaround-to-chrome-select-on-focus-bug
function select_on_focus(field_id) { function select_on_focus(field_id) {
$("#" + field_id).focus(function(e) { $("#" + field_id).focus(function(e) {
$("#" + field_id).select().mouseup(function (e) { $("#" + field_id).select().one('mouseup', function (e) {
e.preventDefault(); e.preventDefault();
$(this).unbind("mouseup");
}); });
}); });
} }