简体   繁体   English

如何在Tiny MCE 4.5中显示侧边栏?

[英]How do I show the sidebar in Tiny MCE 4.5?

In the newest documentation for TinyMCE 4.5, there is some sample code for adding sidebars to your editor. 在TinyMCE 4.5的最新文档中,有一些示例代码用于将侧边栏添加到编辑器中。 I've tried adding this sample code to my project (and it successfully populates a sidebar array in the editor object), but I can't find out how to actually show the sidebar. 我曾尝试将此示例代码添加到我的项目中(并成功在编辑器对象中填充了侧边栏数组),但是我无法找到如何实际显示侧边栏。

Does anyone know how to actually show the sidebar once it has been added? 有人知道添加侧边栏后如何真正显示它吗?

The sample code (which I've tried adding to my project) is: 示例代码(我尝试将其添加到项目中)是:

editor.addSidebar('mysidebar', {
  tooltip: 'My sidebar',
  icon: 'settings',
  onrender: function (api) {
    console.log('Render panel', api.element());
  },
  onshow: function (api) {
    console.log('Show panel', api.element());
    api.element().innerHTML = 'Hello world!';
  },
  onhide: function (api) {
    console.log('Hide panel', api.element());
  }
});

The page from the TinyMCE help that I'm using is: TinyMCE - Create a sidebar 我正在使用的TinyMCE帮助页面是: TinyMCE-创建侧边栏

Not quite sure what you mean, if there is a sidebar configured, it will appear to the right of the content area. 不确定您的意思,如果配置了侧边栏,它将显示在内容区域的右侧。

http://fiddle.tinymce.com/gEfaab http://fiddle.tinymce.com/gEfaab

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM