animate preview mode sidebar
This commit is contained in:
parent
65233c2464
commit
77d4ffba86
@ -18,6 +18,7 @@ body {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
transition: width 500ms, min-width 500ms, max-width 500ms;
|
||||||
min-width: 20%;
|
min-width: 20%;
|
||||||
max-width: 80%;
|
max-width: 80%;
|
||||||
resize: horizontal;
|
resize: horizontal;
|
||||||
|
|||||||
@ -16,10 +16,13 @@ body {
|
|||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
min-height: auto;
|
min-height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@slideTime: 500ms;
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
transition: width @slideTime, min-width @slideTime, max-width @slideTime;
|
||||||
min-width: 20%;
|
min-width: 20%;
|
||||||
max-width: 80%;
|
max-width: 80%;
|
||||||
resize: horizontal;
|
resize: horizontal;
|
||||||
|
|||||||
@ -53,6 +53,7 @@ define([
|
|||||||
|
|
||||||
var andThen = function (CMeditor) {
|
var andThen = function (CMeditor) {
|
||||||
var CodeMirror = Cryptpad.createCodemirror(CMeditor, ifrw, Cryptpad);
|
var CodeMirror = Cryptpad.createCodemirror(CMeditor, ifrw, Cryptpad);
|
||||||
|
$iframe.find('.CodeMirror').addClass('fullPage');
|
||||||
editor = CodeMirror.editor;
|
editor = CodeMirror.editor;
|
||||||
|
|
||||||
var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox');
|
var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox');
|
||||||
@ -145,8 +146,13 @@ define([
|
|||||||
var $codeMirror = $iframe.find('.CodeMirror');
|
var $codeMirror = $iframe.find('.CodeMirror');
|
||||||
if (mode === "markdown") {
|
if (mode === "markdown") {
|
||||||
APP.$previewButton.show();
|
APP.$previewButton.show();
|
||||||
$previewContainer.show();
|
Cryptpad.getPadAttribute('previewMode', function (e, data) {
|
||||||
$codeMirror.removeClass('fullPage');
|
if (e) { return void console.error(e); }
|
||||||
|
if (data !== false) {
|
||||||
|
$previewContainer.show();
|
||||||
|
$codeMirror.removeClass('fullPage');
|
||||||
|
}
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
APP.$previewButton.hide();
|
APP.$previewButton.hide();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user