45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
import BaseFormInput from './base-form-input';
|
|
import $ from 'jquery'
|
|
|
|
export default BaseFormInput.extend({
|
|
didInsertElement() {
|
|
const me = this;
|
|
me._super(...arguments);
|
|
//intialize wysiwyg editor
|
|
$('.wysiwyg-editor', me.element).ace_wysiwyg({
|
|
toolbar: [
|
|
'font',
|
|
null,
|
|
'fontSize',
|
|
null,
|
|
'bold',
|
|
'italic',
|
|
'strikethrough',
|
|
'underline',
|
|
null,
|
|
'insertunorderedlist',
|
|
'insertorderedlist',
|
|
'outdent',
|
|
'indent',
|
|
null,
|
|
'justifyleft',
|
|
'justifycenter',
|
|
'justifyright',
|
|
'justifyfull',
|
|
null,
|
|
'createLink',
|
|
'unlink',
|
|
// null,
|
|
// 'insertImage',
|
|
null,
|
|
'foreColor',
|
|
null,
|
|
'undo',
|
|
'redo'
|
|
]
|
|
}).on('DOMSubtreeModified propertychange', function() {
|
|
me.setVal($(this).html());
|
|
}).html(me.getVal()).prev().addClass('wysiwyg-style2');
|
|
}
|
|
});
|