From bde32eb7dfba95b168d8e2d295835a7ce596c2ba Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 10 Dec 2016 15:51:55 +0100 Subject: more wiki fullscreen optimisation --- view/tpl/wiki.tpl | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'view/tpl/wiki.tpl') diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 11c0cb2ca..8ccb90d98 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -19,7 +19,7 @@ {{/if}} - +

{{$wikiheaderName}}: @@ -147,6 +147,9 @@ theme: "ace/theme/github", mode: "ace/mode/markdown", + maxLines: Infinity, + minLines: 30, + wrap: true, printMargin: false @@ -167,9 +170,14 @@ {{/if}} $('#edit-pane-tab').click(function (ev) { - setTimeout(function() {window.editor.focus(); adjustFullscreenEditorHeight();}, 500); // Return the focus to the editor allowing immediate text entry - $('#page-tools').show(); + setTimeout(function() { + window.editor.focus(); + if($('main').hasClass('.fullscreen')) { + adjustFullscreenEditorHeight(); + } + }, 500); // Return the focus to the editor allowing immediate text entry + $('#page-tools').show(); }); $('#wiki-get-preview').click(function (ev) { @@ -326,10 +334,24 @@ function adjustFullscreenEditorHeight() { $('#editor, #ace-editor').height($(window).height() - $('#id_commitMsg_wrapper').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - $('#wiki-nav-tabs').outerHeight(true) - 17); + {{if !$mimeType || $mimeType == 'text/markdown'}} + editor.setOptions({ + maxLines: '', + minLines: '' + }); + editor.resize(); + {{/if}} } function adjustInlineEditorHeight() { - $('#editor, #ace-editor').height($(window).height() - $('#id_commitMsg_wrapper').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - $('nav').outerHeight(true) - 23); + $('#editor').height(500); + {{if !$mimeType || $mimeType == 'text/markdown'}} + editor.setOptions({ + maxLines: Infinity, + minLines: 30 + }); + + {{/if}} } $('#embed-image').click(function (ev) { -- cgit v1.2.3