summernote 拖放选项不起作用
summernote drag and drop option does not work
我将 summernote 编辑器放在我的网络应用程序中。
而且我发现它仍然可以将图像拖放到编辑器区域。当然,我用下面的代码屏蔽了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);
}
}
});
Summernote 不会动态更新它的选项。创建编辑器时应传递 disableDragAndDrop
选项。例如...
// 01. create editor with options.
$('#summernote').summernote({
disableDragAndDrop:true,
height: 200
});
// 02. then call disable API
$('#summernote').summernote('disable');
有关选项的更多详细信息....
我将 summernote 编辑器放在我的网络应用程序中。
而且我发现它仍然可以将图像拖放到编辑器区域。当然,我用下面的代码屏蔽了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);
}
}
});
Summernote 不会动态更新它的选项。创建编辑器时应传递 disableDragAndDrop
选项。例如...
// 01. create editor with options.
$('#summernote').summernote({
disableDragAndDrop:true,
height: 200
});
// 02. then call disable API
$('#summernote').summernote('disable');
有关选项的更多详细信息....