Jun*_* Oh 4 drag-and-drop google-chrome disabled-input twitter-bootstrap summernote
我将summernote 编辑器放在我的Web 应用程序中。
而且我发现它仍然能够将拖放图像拖到编辑器区域中。当然我用下面的代码屏蔽了summernote的输入。(以下方法在summernote官网提供)
summernote.summernote('disable');
summernote.summernote({
disableDragAndDrop : true
});
Run Code Online (Sandbox Code Playgroud)
我还能尝试什么?
仅供参考,我已经初始化了我的夏季笔记,例如......
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);
}
}
});
Run Code Online (Sandbox Code Playgroud)
Summernote 不会动态更新它的选项。您应该disableDragAndDrop在创建编辑器时传递选项。例如...
// 01. create editor with options.
$('#summernote').summernote({
disableDragAndDrop:true,
height: 200
});
// 02. then call disable API
$('#summernote').summernote('disable');
Run Code Online (Sandbox Code Playgroud)
有关选项的更多详细信息....
http://summernote.org/deep-dive/#initialization-options
| 归档时间: |
|
| 查看次数: |
4420 次 |
| 最近记录: |