mirror of https://github.com/zulip/zulip.git
Use jQuery.one() instead of binding and unbinding a handler
(imported from commit 23b87ee500c0739b04e6fa3c89065d4af13ab9b5)
This commit is contained in:
parent
369f5e9d80
commit
9de11f4df1
|
@ -125,9 +125,8 @@ function handle_keyup(e) {
|
|||
// http://stackoverflow.com/questions/3380458/looking-for-a-better-workaround-to-chrome-select-on-focus-bug
|
||||
function select_on_focus(field_id) {
|
||||
$("#" + field_id).focus(function(e) {
|
||||
$("#" + field_id).select().mouseup(function (e) {
|
||||
$("#" + field_id).select().one('mouseup', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).unbind("mouseup");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue