Commit 4da1e1c4 by tady

fix split editor

parent d2705349
......@@ -15,7 +15,7 @@ $.extend
$window = $(window)
editor_height = 0
settings.$preview.css('overflow-y', 'scroll')
settings.$preview.css('overflow', 'scroll')
# Set editor & preview height
adjustHeight = ->
......
......@@ -30,55 +30,55 @@
p.actions
= f.date_select :specified_date
table
tr
td.editor-panel
.panel.panel-default
.panel-heading
.btn-toolbar role="toolbar"
.btn-group.btn-group-xs
button.btn.btn-default.mod-mdEditor-btn-h1 type="button" title="Header level 1" H1
button.btn.btn-default.mod-mdEditor-btn-h2 type="button" title="Header level 2" H2
button.btn.btn-default.mod-mdEditor-btn-h3 type="button" title="Header level 3" H3
.btn-group.btn-group-xs
button.btn.btn-default.mod-mdEditor-btn-bold type="button" title="Text bold"
i.fa.fa-bold
button.btn.btn-default.mod-mdEditor-btn-italic type="button" title="Text itelic"
i.fa.fa-italic
.btn-group.btn-group-xs
button.btn.btn-default.mod-mdEditor-btn-ol type="button" title="順序リスト"
i.fa.fa-list-ol
button.btn.btn-default.mod-mdEditor-btn-ul type="button" title="リスト"
i.fa.fa-list-ul
button.btn.btn-default.mod-mdEditor-btn-strikethrough type="button" title="打ち消し線"
i.fa.fa-strikethrough
.btn-group.btn-group-xs
button#uploadButton.btn.btn-default type="button" title="Upload"
| Upload
.btn-group.btn-group-xs.pull-right.mode-editor
button#uploadButton.btn.btn-default type="button"
i.fa.fa-angle-right
.btn-group.btn-group-xs.pull-right.mode-split style="display:none"
button#uploadButton.btn.btn-default type="button"
i.fa.fa-angle-left
.panel-body.panel-body-nopadding style="position:relative"
= f.text_area :body, class: 'mod-mdEditor-textarea mod-form-resizer-editor', placehoder: 'type your text....'
#progress-wrapper style="display:none;position:absolute;bottom:0;z-index:1000;width:100%"
.alert.alert-warning.fade.in style="margin-bottom:0"
span.progress-title
| Uploading files...
#progress style="height:20px;"
.progress-bar.progress-bar-success.progress-bar-striped.active role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"
| 0%
td.preview-panel
.panel.preview-wrapper
.panel-heading
span Preview
.panel-body.text-box.body.viewer.github.mod-mdEditor-preview.mod-form-resizer-preview
.row
.col-xs-6.editor-panel
.panel.panel-default
.panel-heading
.btn-toolbar role="toolbar"
.btn-group.btn-group-xs
button.btn.btn-default.mod-mdEditor-btn-h1 type="button" title="Header level 1" H1
button.btn.btn-default.mod-mdEditor-btn-h2 type="button" title="Header level 2" H2
button.btn.btn-default.mod-mdEditor-btn-h3 type="button" title="Header level 3" H3
.btn-group.btn-group-xs
button.btn.btn-default.mod-mdEditor-btn-bold type="button" title="Text bold"
i.fa.fa-bold
button.btn.btn-default.mod-mdEditor-btn-italic type="button" title="Text itelic"
i.fa.fa-italic
.btn-group.btn-group-xs
button.btn.btn-default.mod-mdEditor-btn-ol type="button" title="順序リスト"
i.fa.fa-list-ol
button.btn.btn-default.mod-mdEditor-btn-ul type="button" title="リスト"
i.fa.fa-list-ul
button.btn.btn-default.mod-mdEditor-btn-strikethrough type="button" title="打ち消し線"
i.fa.fa-strikethrough
.btn-group.btn-group-xs
button#uploadButton.btn.btn-default type="button" title="Upload"
| Upload
.btn-group.btn-group-xs.pull-right.mode-editor
button#uploadButton.btn.btn-default type="button"
i.fa.fa-angle-right
.btn-group.btn-group-xs.pull-right.mode-split style="display:none"
button#uploadButton.btn.btn-default type="button"
i.fa.fa-angle-left
.panel-body.panel-body-nopadding style="position:relative"
= f.text_area :body, class: 'mod-mdEditor-textarea mod-form-resizer-editor', placehoder: 'type your text....'
#progress-wrapper style="display:none;position:absolute;bottom:0;z-index:1000;width:100%"
.alert.alert-warning.fade.in style="margin-bottom:0"
span.progress-title
| Uploading files...
#progress style="height:20px;"
.progress-bar.progress-bar-success.progress-bar-striped.active role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"
| 0%
.col-xs-6.preview-panel
.panel.preview-wrapper
.panel-heading
span Preview
.panel-body.text-box.body.viewer.github.mod-mdEditor-preview.mod-form-resizer-preview
input#fileupload data-url="/apis/file_receiver" multiple="" name="files[]" style="display:none" type="file" /
......@@ -91,12 +91,12 @@ input#fileupload data-url="/apis/file_receiver" multiple="" name="files[]" style
$('.mode-editor button').on('click', function(){
$('.mode-editor').hide();
$('.mode-split').show();
$('.editor-panel').css('width', '100%'); $('.editor-panel').show(); $('.preview-panel').hide();
$('.editor-panel').addClass('col-xs-12').removeClass('col-xs-6'); $('.preview-panel').hide();
})
$('.mode-split button').on('click', function(){
$('.mode-split').hide();
$('.mode-editor').show();
$('.editor-panel').css('width', '50%'); $('.preview-panel').css('width', '50%'); $('.editor-panel').show(); $('.preview-panel').show();
$('.editor-panel').addClass('col-xs-6').removeClass('col-xs-12'); $('.preview-panel').show();
})
$('#post-form').mod_mdEditor({end_point: '/apis/markdown_preview'});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment