将TinyMCE内联编辑器工具栏保持在一行中

问题描述 投票:0回答:1

TinyMCE内联编辑器工具栏在编辑器元素左侧和窗口右侧之间的像素差小于工具栏的宽度时变为两行。有没有一种方法可以禁用此行为,而是将工具栏向左移动,以便可以将其显示为全角?

Current situation (right side of image is right side of window)

What I want to achieve, this image is photoshopped so the layout is right (right side of image is right side of window)

我使用以下对象初始化TinyMCE 5编辑器:

var textEditorConfig = {
  menubar: false,
  inline: true,
  plugins: [
    'link',
    'lists',
    'autolink',
  ],
  toolbar: [
    'undo redo | bold italic underline | formatselect fontselect | forecolor | alignleft aligncenter alignright'
  ],

  block_formats: 'Paragraph=p;Header 1=h1;Header 2=h2;Header 3=h3',
};



textEditorConfig.target = target; // This target variable is just a DOM element


tinymce.init(textEditorConfig);
tinymce tinymce-4 tinymce-5
1个回答
1
投票
toolbar_mode

有四种模式可供选择。 toolbar_mode: 'scrolling' 模式将溢出工具栏选项包装到第二行。其他三种模式中的任何一种-wrapfloatingsliding将工具栏保持为一行。工具栏的默认模式是scrolling

但是,使用多个工具栏或工具栏(n)选项时,工具栏模式不可用。

[当工具栏配置有以空格分隔的字符串数组时,它被配置为floating

[通过提供单个字符串(不带方括号)来配置单个工具栏:

multiple toolbars

© www.soinside.com 2019 - 2024. All rights reserved.