Opened 16 years ago
Closed 11 years ago
#9841 closed enhancement (fixed)
TinyMCE's kitchen sink button should also hide lines 3 and 4 when present
Reported by: | Denis-de-Bernardy | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | minor | Version: | 2.8 |
Component: | TinyMCE | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
Currently, adding a button to line 3 or 4 of TinyMCE results in their always being present.
Would it be possible/desirable to make the hide as well?
Attachments (4)
Change History (17)
#3
@
15 years ago
- Cc MadtownLems added
This is a great suggestion. I've tried to do it myself with no luck. As more and more plugins with buttons are developed, this becomes more and more important.
I strongly support this feature request!
#4
@
15 years ago
I'd recommend line 3 being hidden and line 4 being not. That'd result in two lines always on and two togglable. I'd say make 1/2 always on, but that'd break backwards compatbility more so.
#5
follow-up:
↓ 6
@
15 years ago
@Viper: good idea. there's a potential TinyMCE bug if we do that, though, if line 3 is empty but line 4 is not.
#6
in reply to:
↑ 5
@
15 years ago
Replying to Denis-de-Bernardy:
...there's a potential TinyMCE bug if we do that, though, if line 3 is empty but line 4 is not.
That was fixed some time ago https://core.trac.wordpress.org/browser/trunk/wp-admin/includes/post.php#L1460
#7
@
15 years ago
@azaozz: yes, I remembered how you "fixed" it, and that's precisely why I'm raising it here.
With the patch that you applied, Viper's idea becomes broken, because line 4 would become line 3, and thus be invisible.
#8
@
13 years ago
- Keywords has-patch needs-testing added
I'm no JS guru, so I'm sure someone else can clean this up.
But as it is, it appears to work nicely for hiding the 3rd and/or 4th row of buttons in the Visual Editor's toolbar, if they exist.
(Side note: the .dev version was not loaded when SCRIPT_DEBUG was set to true. see #16578)
#9
@
13 years ago
I still find it awkward that the kitchen sink only toggles the second row, even when there are additional buttons on rows 3 and/or 4.
#10
follow-up:
↓ 11
@
13 years ago
piggybacked off of @trepmal edits and made it so it will toggle any number of button bars (infinite) after the first one... really would be nice to get this pushed.
@
13 years ago
toggles any additional rows added after the first one (first file wasn't diff file... noob)
#11
in reply to:
↑ 10
;
follow-up:
↓ 12
@
13 years ago
Replying to luckykind:
Yes, that would work although I would probably hide/show all toolbars (table.mceToolbar) at once. TinyMCE has pretty good DOM traversing and selection API similar to jQuery's, look at the tinymce.DOM
methods.
Still thinking this is plugin material as you cannot have 3rd and 4th toolbar without using a plugin.
#12
in reply to:
↑ 11
@
13 years ago
Replying to azaozz:
Replying to luckykind:
Still thinking this is plugin material as you cannot have 3rd and 4th toolbar without using a plugin.
Sorry, I don't understand what you mean here... I tested this adding additional toolbars (well over 3 or 4) and it worked perfectly fine without a plugin. Even without this I can add additional toolbars without a plugin, they're just not hidden like the kitchen sink items. It would be nice to have one visible toolbar and any additional toolbars hidden and toggled by the kitchen sink button. That is what the patch I added does. If there's a better way to code it... feel free to change it, but the logic behind the functionality is there.
There are some more options for the TinyMCE's toolbars, can probably look at that for 2.9+.