【发布时间】:2016-05-23 15:47:11
【问题描述】:
我将 Summernote 编辑器放在我的 Web 应用程序中。
我发现它仍然可以将图像拖放到编辑器区域。当然我用下面的代码屏蔽了summernote的输入。(下面的方法在summernote官网提供)
summernote.summernote('disable');
summernote.summernote({
disableDragAndDrop : true
});
我还能尝试什么?
仅供参考,我已经像...一样初始化了我的夏季笔记
var s_note = $('#${id}_summernote');
var summernote = s_note.summernote({
height : 200
, dialogsInBody : true
, toolbar: [
['style', ['style']],
['font', ['bold', 'italic', 'underline', 'clear']],
['fontname', ['fontname']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
['table', ['table']],
['insert', ['link', 'picture', 'hr']],
['view', ['fullscreen', 'codeview']],
['help', ['help']]
]
, callbacks : {
onImageUpload : function(files){
console.log(files);
var img = document.createElement('img');
img.src='http://summernote.org/img/icons/1200x630.png';
uploadWYSIWYGFile(files);
s_note.summernote('insertNode', img);
}
, onChange : function(){
console.log(1);
var richValue = s_note.summernote('code');
valueHolder.val(richValue);
}
}
});
【问题讨论】:
标签: twitter-bootstrap google-chrome drag-and-drop summernote disabled-input