首页 文章

如何在TinyMCE窗口中显示列表框onselect

提问于
浏览
2

我正试图在TinyMCE窗口中显示隐藏的列表框 . 我想在用户选择一个选项后显示列表框 . 目前我有它在onselect函数中显示另一个弹出窗口 . 这是我到目前为止所拥有的 .

tinymce.PluginManager.add('newbutton', function( editor, url ) {
    editor.addButton( 'newbutton', {
        title: 'Button',
        text: 'Here is the button',
        onclick: function() {
            editor.windowManager.open({
                title: 'Choose From Listbox 1',
                body: [
                    {
                        type: 'listbox',
                        name: 'vals',
                        label: 'Choose Vals',
                        values: listvals,
                        onselect: function(e){
                            //I want to show another listbox on the same body 
                            editor.windowManager.open({
                                title: 'Choose',
                                body: [
                                    {
                                        type: 'listbox',
                                        name: 'List',
                                        label: 'Choose Style:',
                                        values: fonts,
                                        onselect: function(e){
                                            style = this.value();

                                        }
                                    }
                                ]

                            })
                        }
                    }
                ],
                onsubmit: function(e){

                }
            })
        }
    });
});

我想要相同的功能,但我不想弹出另一个窗口,我想在同一个窗口显示第二个列表框 .

1 回答

  • 0

    猜想要实现这一点,你工具栏并将它的变化事件绑定到一个函数(除非想把它附加到其他地方,工具栏很可能就是它应该属于的地方) . 例如:Guide to Creating Your Own WordPress Editor Buttons

相关问题