From 6341f070bac51b99aa251133ebc154f2b8e2e760 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 7 Dec 2011 11:44:44 +0100 Subject: [PATCH] Open the QR focused when using the 'Open QR without post number inserted' keybind --- 4chan_x.user.js | 7 ++----- changelog | 1 + script.coffee | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index a47dcbd4e..c6650384b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1072,11 +1072,8 @@ if (quote) { return qr.quote.call($('.quotejs + a', $('.replyhl', thread) || thread)); } else { - if (qr.el) { - return $('textarea', qr.el).focus(); - } else { - return qr.dialog('', thread != null ? thread.firstChild.id : void 0); - } + if (!qr.el) qr.dialog('', thread != null ? thread.firstChild.id : void 0); + return $('textarea', qr.el).focus(); } }, open: function(thread, tab) { diff --git a/changelog b/changelog index 5dab58ce4..323fd991d 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,7 @@ master - mayhem quotes are now inserted at the caret position in the QR quotes also replace the text selection in the QR + open QR focused when using the `Open QR without post number inserted` keybind - aeosynth update the captcha caching expiration date to 30mins diff --git a/script.coffee b/script.coffee index af69c225b..35ffc136d 100644 --- a/script.coffee +++ b/script.coffee @@ -750,10 +750,9 @@ keybinds = if quote qr.quote.call $ '.quotejs + a', $('.replyhl', thread) or thread else - if qr.el - $('textarea', qr.el).focus() - else + unless qr.el qr.dialog '', thread?.firstChild.id + $('textarea', qr.el).focus() open: (thread, tab) -> id = thread.firstChild.id