function () {
        const editor = this.editor
        const $toolbarElem = editor.$toolbarElem
        const menus = this.menus
        const config = editor.config
        // config.zIndex 是配置的编辑区域的 z-index，菜单的 z-index 得在其基础上 +1
        const zIndex = config.zIndex + 1
        objForEach(menus, (key, menu) => {
            const $elem = menu.$elem
            if ($elem) {
                // 设置 z-index
                $elem.css('z-index', zIndex)
                $toolbarElem.append($elem)
            }
        })
    }
function () {
        const editor = this.editor
        const $toolbarElem = editor.$toolbarElem
        const menus = this.menus
        const config = editor.config
        // config.zIndex 是配置的编辑区域的 z-index，菜单的 z-index 得在其基础上 +1
        const zIndex = config.zIndex + 1
        objForEach(menus, (key, menu) => {
            const $elem = menu.$elem
            if ($elem) {
                // 设置 z-index
                $elem.css('z-index', zIndex)
                $toolbarElem.append($elem)
            }
        })
    }
function ( ) { const editor = this . editor const $toolbarElem = editor . $toolbarElem const menus = this . menus const config = editor . config // config.zIndex 是配置的编辑区域的 z-index，菜单的 z-index 得在其基础上 +1 const zIndex = config . zIndex + 1 objForEach ( menus , ( key , menu ) => { const $elem = menu . $elem if ( $elem ) { // 设置 z-index $elem . css ( 'z-index' , zIndex ) $toolbarElem . append ( $elem ) } } ) }
添加到菜单栏
添加到菜单栏
Add a new menu element to the toolbar