Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
482 views
in Technique[技术] by (71.8m points)

javascript - TinyMCE: How to display all toolbars on a single row?

This question is basically reverse of Is there a way to wrap the toolbar buttons to the next row in TinyMCE if the width of the editor is too small?

I have a TinyMCE editor where I have buttons specified via theme_advanced_buttons1, theme_advanced_buttons2 and theme_advanced_buttons3. Each toolbar row is designed to be pretty short to make sure that the layout will not overflow horizontally.

Is there a way to get toolbars to reposition on a single line if they can all fit? (E.g. visitor has a wide-screen display and the browser window is maximized.)

I'm thinking it could be possible via CSS by settings display:block and float:left to toolbar rows (the tr elements). Perhaps add clear: left to some (which?) following element to prevent overflowing to editor area. However, this seems like an ugly hack. I'm hoping you can come up with something better.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Each line of buttons is wrapped in a table so theme_advanced_buttons1 is inside a table, theme_advanced_buttons2 is inside another table and theme_advanced_buttons3 is inside another one, so to make them inline you can use

.wp_themeSkin table.mceToolbar {
  margin: 0 6px 2px; // this is by default
  display: inline-table; // this is extra I've added to keep them in single line
}

Below is a screenshot of display: inline-table; in full screen mode of the editor, all three lines of buttons are in one line, side by side

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...