summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@controlyourself.ca>2009-08-04 15:53:15 +0000
committerSarven Capadisli <csarven@controlyourself.ca>2009-08-04 15:53:15 +0000
commitd0a020dd4ea8d58bc8230ebcde22e54ad31894a8 (patch)
treec7d14f1e09bd46c72e577ca54645a7bab4a747e7 /js
parent5f3af3e121a7ff06f5961bb4158e0b777ce5b5c1 (diff)
parentffa1d662a759a729151f2444bdf759749d59045e (diff)
Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
Diffstat (limited to 'js')
-rw-r--r--js/util.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/util.js b/js/util.js
index f3ed918cf..9d6e52b2d 100644
--- a/js/util.js
+++ b/js/util.js
@@ -25,7 +25,7 @@ $(document).ready(function(){
var counter = $("#notice_text-count");
counter.text(remaining);
- if (remaining <= 0) {
+ if (remaining < 0) {
$("#form_notice").addClass("warning");
} else {
$("#form_notice").removeClass("warning");
@@ -256,10 +256,15 @@ function NoticeReplySet(nick,id) {
rgx_username = /^[0-9a-zA-Z\-_.]*$/;
if (nick.match(rgx_username)) {
replyto = "@" + nick + " ";
- if ($("#notice_data-text").length) {
- $("#notice_data-text").val(replyto);
+ var text = $("#notice_data-text");
+ if (text.length) {
+ text.val(replyto + text.val());
$("#form_notice input#notice_in-reply-to").val(id);
- $("#notice_data-text").focus();
+ if (text.get(0).setSelectionRange) {
+ var len = text.val().length;
+ text.get(0).setSelectionRange(len,len);
+ text.get(0).focus();
+ }
return false;
}
}