simditor
simditor copied to clipboard
simditor报错The given range isn't in document.
当我在angular中想使用simditor的插入链接功能是报错The given range isn't in document.
directive('editor', function () { return { restrict: 'A', link: function (scope, element, attrs) { let toolbar = ['title', 'bold', 'italic', 'underline', 'strikethrough', 'fontScale', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', 'alignment']; let mobileToolbar = ["bold", "underline", "strikethrough", "color", "ul", "ol"]; let fileUrl = "/upload"
var editor = new Simditor({
textarea: element,
toolbar: toolbar,
pasteImage: true,
//编辑器插入图片时使用的默认图片
defaultImage: 'http://7xvm87.com1.z0.glb.clouddn.com/random@55684e0e77e',
upload: {
url: fileUrl, //文件上传的接口地址
//键值对,指定文件上传接口的额外参数,上传的时候随文件一起提交
params: { 'filename': 'versions' },
fileKey: 'file', //服务器端获取文件数据的参数名
connectionCount: 3,
leaveConfirm: '正在上传文件',
}
});
editor.setValue(element.val())
if (element.length > 0) { function hide() { editor.on('valuechanged', function (e) { var index = element.eq(0).attr("id").split('')[1] scope.content[index].Content = editor.getValue() return element.html(editor.getValue()); }); editor.on('blur', function (e) { var index = element.eq(0).attr("id").split('')[1] editor.setValue(scope.content[index].Content) }) editor.on('focus', function (e) { var index = element.eq(0).attr("id").split('_')[1] editor.setValue(scope.content[index].Content) }) } return hide()
}
}
该插件在ie9下面无法 粘贴文字内容
simditor报错The given range isn't in document 这个问题太频繁了报的,不知道如何解决,不停的点击ul 在点击删除 很容易出现的
simditor报错The given range isn't in document 这个问题太频繁了报的,不知道如何解决,不停的点击ul 在点击删除 很容易出现的
simditor报错The given range isn't in document 这个问题太频繁了报的,不知道如何解决,不停的点击ul 在点击删除 很容易出现的
Uncaught TypeError: Cannot read property 'first' of undefined at Object.* (simditor.js:1102) at Keystroke.respondTo (simditor.js:1033) at InputManager._onKeyDown (simditor.js:949) at HTMLDivElement.f (jquery.min.js:2) at HTMLDivElement.dispatch (jquery.min.js:3) at HTMLDivElement.r.handle (jquery.min.js:3)
官网的例子 随便点击一下,各种脚本错误,如上