summaryrefslogtreecommitdiff
path: root/public/assets/js/lib
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-04-25 17:06:45 +0200
committerJules Laplace <julescarbon@gmail.com>2018-04-25 17:06:45 +0200
commit4a99effeb025e6ed6f1a2667a533894aa1fe2f46 (patch)
tree0eaa4d68865af4c3e1643035f8529f5bb9203a61 /public/assets/js/lib
parent0645d1ada0ad41cc9e53b1b3f452ecc35b35ab12 (diff)
focusing on mail
Diffstat (limited to 'public/assets/js/lib')
-rw-r--r--public/assets/js/lib/views/details/editcomment.js1
-rw-r--r--public/assets/js/lib/views/mail/compose.js11
2 files changed, 10 insertions, 2 deletions
diff --git a/public/assets/js/lib/views/details/editcomment.js b/public/assets/js/lib/views/details/editcomment.js
index 39d8a45..2f9a3b5 100644
--- a/public/assets/js/lib/views/details/editcomment.js
+++ b/public/assets/js/lib/views/details/editcomment.js
@@ -20,6 +20,7 @@ var EditCommentForm = FormView.extend({
this.action = "/api/comment/" + id
$.get(this.action, function(data){
this.$comment.val(data.comment.comment).focus()
+ setCaretToPos(this.$comment.get(0), 0, 0)
$("body").removeClass("loading")
}.bind(this))
},
diff --git a/public/assets/js/lib/views/mail/compose.js b/public/assets/js/lib/views/mail/compose.js
index f2592ea..3d75016 100644
--- a/public/assets/js/lib/views/mail/compose.js
+++ b/public/assets/js/lib/views/mail/compose.js
@@ -23,15 +23,22 @@ var ComposeView = FormView.extend({
.replace(/{{date}}/, date[0])
.replace(/{{time}}/, date[1])
.replace(/&nbsp;/g, " ")
- console.log(tmpl)
+ // console.log(tmpl)
this.$("[name=username]").val(message.sender)
this.$("[name=subject]").val(message.subject)
- this.$("[name=body]").val(tmpl + message.body)
+ this.$("[name=body]").val(tmpl + message.body).focus()
+ setCaretToPos(this.$("[name=body]").get(0), 0, 0)
$("body").removeClass('loading')
}.bind(this))
return
}
this.$("[name=username]").val(username)
+ if (!username) {
+ this.$("[name=username]").focus()
+ }
+ else {
+ this.$("[name=body]").focus()
+ }
$("body").removeClass('loading')
},