Authored by weiqingting

编辑器

var $ = require('jquery'),
common = require('../common/common');
require('../common/umeditor.config');
require('../common/umeditor');
require('../common/zh-cn');
var baidu;
/*获取数据ViewModel*/
... ... @@ -104,6 +109,9 @@ var Bll = {
button: [{
value: "保存",
callback: function () {
if(module.contentData.dialog=="template_dialog_text"){
module.contentData.data.text=baidu.getContent();
}
if (components.validate()) {
//TODO
!!~index ? Bll.contentDatas[index] = module : Bll.contentDatas.push(module);
... ... @@ -116,6 +124,13 @@ var Bll = {
}]
});
Bll.__editRender();
if(module.contentData.dialog=="template_dialog_text"){
baidu&&baidu.destroy();
baidu=UM.getEditor('baidueditor');
baidu.setContent(module.contentData.data.text);
}
},
renderDialog: function (templater) {
Bll.__render(".modal-body", templater, Bll.module);
... ...
... ... @@ -343,10 +343,9 @@
</script>
<!-- 文本弹层 -->
<script type="text/template" id="template_dialog_text">
<script type="text/template" id="template_dialog_text" >
<div class="rows">
<textarea rows="2" class="form-control observe" placeholder="文章摘要"
data-field="text">[[contentData.data.text]]</textarea>
<script id="baidueditor" style="width: 100%;" name="content" type="text/plain"></script>
</div>
</script>
... ...