Baidu editor after a fixed height of the image frame positioning allowed

Baidu editor after a fixed height of the image frame positioning allowed

Fixed height attribute: initialFrameHeight: 400

Positioning allowed screenshots:

 

 

 

Modify: ueditor.all.js file attachTo the top; FIG commented inaccurate positioning, under changed unannotated;

            attachTo: function (targetObj) {
                var me = this,
                    target = me.target = targetObj,
                    resizer = this.resizer,
                    imgPos = domUtils.getXY(target),
                    iframePos = domUtils.getXY(me.editor.iframe),
                    editorPos = domUtils.getXY(resizer.parentNode);
       
                domUtils.setStyles(resizer, {
                    'width': target.width + 'px',
                    'height': target.height + 'px',
                    'left': iframePos.x + imgPos.x - me.editor.document.body.scrollLeft - editorPos.x - parseInt(resizer.style.borderLeftWidth) + 'px',
                    //'top': iframePos.y + imgPos.y - me.editor.document.body.scrollTop - editorPos.y - parseInt(resizer.style.borderTopWidth) + 'px'
                    'top': iframePos.y + target.y - me.editor.document.body.scrollTop - editorPos.y - parseInt(resizer.style.borderTopWidth) + 'px'

                });
            }

 

Guess you like

Origin www.cnblogs.com/tong2018/p/12567662.html