Feat:去除richTextEditFakeInPlace实例化选项
This commit is contained in:
parent
ec677c781e
commit
4ef99958b6
@ -437,9 +437,6 @@ export const defaultOpt = {
|
|||||||
transformRichTextOnEnterEdit: null,
|
transformRichTextOnEnterEdit: null,
|
||||||
// 可以传递一个函数,即将结束富文本编辑前会执行该函数,函数接收richText实例,所以你可以在此时机更新quill文档数据
|
// 可以传递一个函数,即将结束富文本编辑前会执行该函数,函数接收richText实例,所以你可以在此时机更新quill文档数据
|
||||||
beforeHideRichTextEdit: null,
|
beforeHideRichTextEdit: null,
|
||||||
// 设置富文本节点编辑框和节点大小一致,形成伪原地编辑的效果
|
|
||||||
// 需要注意的是,只有当节点内只有文本、且形状是矩形才会有比较好的效果
|
|
||||||
richTextEditFakeInPlace: false,
|
|
||||||
|
|
||||||
// 【OuterFrame】插件
|
// 【OuterFrame】插件
|
||||||
outerFramePaddingX: 10,
|
outerFramePaddingX: 10,
|
||||||
|
|||||||
@ -196,7 +196,6 @@ class RichText {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let {
|
let {
|
||||||
richTextEditFakeInPlace,
|
|
||||||
customInnerElsAppendTo,
|
customInnerElsAppendTo,
|
||||||
nodeTextEditZIndex,
|
nodeTextEditZIndex,
|
||||||
textAutoWrapWidth,
|
textAutoWrapWidth,
|
||||||
@ -225,11 +224,6 @@ class RichText {
|
|||||||
// 内边距
|
// 内边距
|
||||||
let paddingX = this.textNodePaddingX
|
let paddingX = this.textNodePaddingX
|
||||||
let paddingY = this.textNodePaddingY
|
let paddingY = this.textNodePaddingY
|
||||||
if (richTextEditFakeInPlace) {
|
|
||||||
let paddingValue = node.getPaddingVale()
|
|
||||||
paddingX = paddingValue.paddingX
|
|
||||||
paddingY = paddingValue.paddingY
|
|
||||||
}
|
|
||||||
if (!this.textEditNode) {
|
if (!this.textEditNode) {
|
||||||
this.textEditNode = document.createElement('div')
|
this.textEditNode = document.createElement('div')
|
||||||
this.textEditNode.classList.add('smm-richtext-node-edit-wrap')
|
this.textEditNode.classList.add('smm-richtext-node-edit-wrap')
|
||||||
@ -274,13 +268,6 @@ class RichText {
|
|||||||
this.textEditNode.style.maxWidth = textAutoWrapWidth + paddingX * 2 + 'px'
|
this.textEditNode.style.maxWidth = textAutoWrapWidth + paddingX * 2 + 'px'
|
||||||
this.textEditNode.style.transform = `scale(${scaleX}, ${scaleY})`
|
this.textEditNode.style.transform = `scale(${scaleX}, ${scaleY})`
|
||||||
this.textEditNode.style.transformOrigin = 'left top'
|
this.textEditNode.style.transformOrigin = 'left top'
|
||||||
if (richTextEditFakeInPlace) {
|
|
||||||
this.textEditNode.style.borderRadius =
|
|
||||||
(node.style.merge('borderRadius') || 5) + 'px'
|
|
||||||
if (node.style.merge('shape') == 'roundedRectangle') {
|
|
||||||
this.textEditNode.style.borderRadius = (node.height || 50) + 'px'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 节点文本内容
|
// 节点文本内容
|
||||||
let nodeText = node.getData('text')
|
let nodeText = node.getData('text')
|
||||||
if (typeof transformRichTextOnEnterEdit === 'function') {
|
if (typeof transformRichTextOnEnterEdit === 'function') {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user