From 9938f2c6058b21c1c3a35f4cba8b8ebc1df9b313 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Fri, 13 Feb 2015 13:40:58 -0600 Subject: [PATCH] Change all textbox keyup to keydown Fixes an issue repoted by dragondread in IRC where a popup character map was unintentionally triggering the keyup event after a character was selected. --- www/js/ui.js | 6 +++--- www/js/util.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/www/js/ui.js b/www/js/ui.js index 287bfb77..66a34840 100644 --- a/www/js/ui.js +++ b/www/js/ui.js @@ -383,7 +383,7 @@ $("#queue_end").click(queue.bind(this, "end", "url")); $("#ce_queue_next").click(queue.bind(this, "next", "customembed")); $("#ce_queue_end").click(queue.bind(this, "end", "customembed")); -$("#mediaurl").keyup(function(ev) { +$("#mediaurl").keydown(function(ev) { if (ev.keyCode === 13) { queue("end", "url"); } else { @@ -416,7 +416,7 @@ $("#mediaurl").keyup(function(ev) { $("").addClass("form-control") .attr("type", "text") .attr("id", "addfromurl-title-val") - .keyup(function (ev) { + .keydown(function (ev) { if (ev.keyCode === 13) { queue("end", "url"); } @@ -546,7 +546,7 @@ $(".cs-checkbox").change(function () { socket.emit("setOptions", data); }); -$(".cs-textbox").keyup(function () { +$(".cs-textbox").keydown(function () { var box = $(this); var key = box.attr("id").replace("cs-", ""); var value = box.val(); diff --git a/www/js/util.js b/www/js/util.js index d173be3a..8c744440 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -2399,7 +2399,7 @@ function formatCSEmoteList() { }; edit.blur(finish); - edit.keyup(function (ev) { + edit.keydown(function (ev) { if (ev.keyCode === 13) { finish(); } @@ -2550,7 +2550,7 @@ function initPm(user) { var input = $("").addClass("form-control pm-input").attr("type", "text") .appendTo(body); - input.keyup(function (ev) { + input.keydown(function (ev) { if (ev.keyCode === 13) { var meta = {}; var msg = input.val();