mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Keyboard shortcut for posting/editing a comment
This commit is contained in:
parent
88d26d446b
commit
3126c5b566
4 changed files with 8 additions and 2 deletions
|
@ -10,7 +10,7 @@
|
|||
{{/constant}}
|
||||
<div class="form-actions">
|
||||
<a class="delete-link" href="/comments/deleted">Delete Comment</a>
|
||||
<input type="submit" value="Submit" />
|
||||
<input type="submit" value="Submit" title="(⌘+enter)" />
|
||||
</div>
|
||||
</form>
|
||||
{{/with}}
|
||||
|
|
|
@ -9,6 +9,9 @@ Template.comment_edit.rendered = function(){
|
|||
if(comment && Meteor.user() && !this.editor){
|
||||
this.editor = new EpicEditor(EpicEditorOptions).load();
|
||||
this.editor.importFile('editor',comment.body);
|
||||
$(this.editor.editor).bind('keydown', 'meta+return', function(){
|
||||
$(window.editor).closest('form').find('input[type="submit"]').click();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</div>
|
||||
{{/constant}}
|
||||
<div class="comment-submit">
|
||||
<input type="submit" class="button" value="Add Comment" />
|
||||
<input type="submit" class="button" value="Add Comment" title="(⌘+enter)" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
Template.comment_form.rendered = function(){
|
||||
if(Meteor.user() && !this.editor){
|
||||
this.editor = new EpicEditor(EpicEditorOptions).load();
|
||||
$(this.editor.editor).bind('keydown', 'meta+return', function(){
|
||||
$(window.editor).closest('form').find('input[type="submit"]').click();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue