Merge pull request #56 from jeena/master

Make posting by Ctrl+Enter possible
This commit is contained in:
Kyle Mahan 2016-05-21 15:47:27 -07:00
commit fcaf82e322

View file

@ -78,6 +78,14 @@ $(function(){
$("#older-link").off('click').click(clickOlderLink);
$(".micropub-form button[type='submit']").off('click').click(submitMicropubForm);
// Post by ctrl/cmd + enter in the text area
$(".micropub-form textarea.content").keyup(function(e) {
if ((e.ctrlKey || e.metaKey) && (e.keyCode == 13 || e.keyCode == 10)) {
var button = $(e.target).closest('form').find('button[value=reply]');
button[0].click();
}
});
$(".micropub-form .content").focus(function () {
$(this).animate({ height: "4em" }, 200);
var $target = $(evt.target);