summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/details/editcomment.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/lib/views/details/editcomment.js')
-rw-r--r--public/assets/js/lib/views/details/editcomment.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/public/assets/js/lib/views/details/editcomment.js b/public/assets/js/lib/views/details/editcomment.js
index a290ac4..39d8a45 100644
--- a/public/assets/js/lib/views/details/editcomment.js
+++ b/public/assets/js/lib/views/details/editcomment.js
@@ -4,6 +4,7 @@ var EditCommentForm = FormView.extend({
events: {
"focus textarea": 'focus',
+ "keydown textarea": 'keydown',
},
action: "",
@@ -26,7 +27,15 @@ var EditCommentForm = FormView.extend({
focus: function(){
this.$el.addClass('focused')
},
-
+
+ keydown: function(e){
+ if ((e.ctrlKey || e.metaKey || e.altKey) && e.keyCode == 83) { // "s" key
+ e.preventDefault()
+ e.stopPropagation()
+ this.save()
+ }
+ },
+
validate: function(){
var errors = []
var comment = $("[name=comment]").val()