lemo-crm/web/app/components/wysiwyg-editor.js
Shaun Chyxion 528e09dbdd init
2017-06-04 22:56:26 +08:00

29 lines
826 B
JavaScript

import Ember from 'ember';
import BaseFormInput from './base-form-input';
export default BaseFormInput.extend({
didInsertElement() {
let me = this;
//intialize wysiwyg editor
me.$('.wysiwyg-editor').ace_wysiwyg({
toolbar: [
'bold',
'italic',
'strikethrough',
'underline',
null,
'justifyleft',
'justifycenter',
'justifyright',
null,
'createLink',
'unlink',
null,
'undo',
'redo'
]}).on('DOMSubtreeModified propertychange', function() {
me.setVal(Ember.$(this).html());
}).html(me.getVal()).prev().addClass('wysiwyg-style1');
}
});