fix chrome quick reply focusing. patch by Seiba.

This commit is contained in:
James Campos 2010-07-19 07:32:33 -07:00
parent 536f100707
commit d06130434a
2 changed files with 2 additions and 2 deletions

View File

@ -488,6 +488,7 @@ quickReply: (e) ->
document.body.appendChild(qr) document.body.appendChild(qr)
textarea: $('textarea', qr) textarea: $('textarea', qr)
textarea.focus()
#we can't just use @textContent b/c of the xxxs. goddamit moot. #we can't just use @textContent b/c of the xxxs. goddamit moot.
textarea.value += '>>' + @parentNode.id.match(/\d+$/)[0] + '\n' textarea.value += '>>' + @parentNode.id.match(/\d+$/)[0] + '\n'
selection: window.getSelection() selection: window.getSelection()
@ -495,7 +496,6 @@ quickReply: (e) ->
if id is this.parentNode.id if id is this.parentNode.id
if selText: selection.toString() if selText: selection.toString()
textarea.value += ">$selText\n" textarea.value += ">$selText\n"
textarea.focus()
return return

View File

@ -504,11 +504,11 @@ cursor: pointer; \
document.body.appendChild(qr); document.body.appendChild(qr);
} }
textarea = $('textarea', qr); textarea = $('textarea', qr);
textarea.focus();
textarea.value += '>>' + this.parentNode.id.match(/\d+$/)[0] + '\n'; textarea.value += '>>' + this.parentNode.id.match(/\d+$/)[0] + '\n';
selection = window.getSelection(); selection = window.getSelection();
id = typeof (_c = (x('preceding::span[@id][1]', selection.anchorNode))) === "undefined" || _c == undefined ? undefined : _c.id; 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; id === this.parentNode.id ? (selText = selection.toString()) ? textarea.value += (">" + selText + "\n") : null : null;
textarea.focus();
return null; return null;
}; };
watch = function() { watch = function() {