From d06130434abe3b9e235ff87339f0c4fa56956507 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 19 Jul 2010 07:32:33 -0700 Subject: [PATCH] fix chrome quick reply focusing. patch by Seiba. --- 4chan_x.coffee | 2 +- 4chan_x.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.coffee b/4chan_x.coffee index 7c525481f..523d5e859 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -488,6 +488,7 @@ quickReply: (e) -> document.body.appendChild(qr) textarea: $('textarea', qr) + textarea.focus() #we can't just use @textContent b/c of the xxxs. goddamit moot. textarea.value += '>>' + @parentNode.id.match(/\d+$/)[0] + '\n' selection: window.getSelection() @@ -495,7 +496,6 @@ quickReply: (e) -> if id is this.parentNode.id if selText: selection.toString() textarea.value += ">$selText\n" - textarea.focus() return diff --git a/4chan_x.js b/4chan_x.js index 00ce1b18d..4ed059e0a 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -504,11 +504,11 @@ cursor: pointer; \ document.body.appendChild(qr); } textarea = $('textarea', qr); + textarea.focus(); textarea.value += '>>' + this.parentNode.id.match(/\d+$/)[0] + '\n'; selection = window.getSelection(); id = typeof (_c = (x('preceding::span[@id][1]', selection.anchorNode))) === "undefined" || _c == undefined ? undefined : _c.id; id === this.parentNode.id ? (selText = selection.toString()) ? textarea.value += (">" + selText + "\n") : null : null; - textarea.focus(); return null; }; watch = function() {