mirror of
https://github.com/documize/community.git
synced 2025-07-19 21:29:42 +02:00
Make Markdown editor use Ember input helper
This commit is contained in:
parent
f73c2f13d4
commit
bc28b36627
2 changed files with 3 additions and 4 deletions
|
@ -33,7 +33,7 @@ export default Component.extend({
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
let body = (is.not.undefined(this.get('meta'))) ? this.get('meta.rawBody').trim() : '';
|
let body = (is.not.undefined(this.get('meta'))) ? this.get('meta.rawBody').trim() : '';
|
||||||
this.set('pageBody', body);
|
this.set('pageBody', body);
|
||||||
},
|
},
|
||||||
|
|
||||||
didInsertElement() {
|
didInsertElement() {
|
||||||
|
@ -67,7 +67,7 @@ export default Component.extend({
|
||||||
dragDrop: false,
|
dragDrop: false,
|
||||||
extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"}
|
extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"}
|
||||||
});
|
});
|
||||||
|
|
||||||
CodeMirror.commands.save = function(/*instance*/){
|
CodeMirror.commands.save = function(/*instance*/){
|
||||||
Mousetrap.trigger('ctrl+s');
|
Mousetrap.trigger('ctrl+s');
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
|
|
||||||
<div class="section-markdown-editor">
|
<div class="section-markdown-editor">
|
||||||
{{#if editMode}}
|
{{#if editMode}}
|
||||||
<textarea id={{editorId}} class="mousetrap">{{{pageBody}}}</textarea>
|
{{textarea id=editorId class="mousetrap" value=pageBody}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="mousetrap wysiwyg section-markdown-preview">
|
<div class="mousetrap wysiwyg section-markdown-preview">
|
||||||
{{{pagePreview}}}
|
{{{pagePreview}}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{/section/base-editor-inline}}
|
{{/section/base-editor-inline}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue