Fullscreen toggle for the markdown editor

This commit is contained in:
Amaia Castro
2016-12-13 12:29:06 +01:00
parent 715d9e5b88
commit c69f1b3e83
5 changed files with 48 additions and 1 deletions

View File

@@ -12,9 +12,18 @@ App.MarkdownEditor =
breaks: true,
typographer: true,
})
App.MarkdownEditor.refresh_preview($(this), md)
$(this).on 'change input paste keyup', ->
App.MarkdownEditor.refresh_preview($(this), md)
return
$(this).find('.fullscreen-toggle').on 'click', ->
$('.markdown-editor').toggleClass('fullscreen')
if $('.markdown-editor').hasClass('fullscreen')
$('.markdown-editor textarea').height($(window).height() - 100)
else
$('.markdown-editor textarea').height("10em")