Opened 14 years ago
Closed 14 years ago
#6144 closed Bug (fixed)
rich combo in a separate looks bad
Reported by: | Charlie | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.5.3 |
Component: | UI : Toolbar | Version: | 3.0 |
Keywords: | HasPatch | Cc: |
Description
Here's a fun one in the Kama Skin. If you create a custom toolbar with ONLY richcombo boxes in it, the CSS margins will be wrong (I.e. Items below it will crowd the bar).
This is because the bottom margin of 5 lies on the toolgroup element. To fix this, the bottom margin CS should be moved from the toolgroup element to the toolbar element. Give it a look!
CKEDITOR.replace( 'editor1', { toolbar: [ ['Styles','Format','Font','FontSize'], '/', ['Bold','Italic','Underline','Strike', 'Paste','PasteText','PasteFromWord','-','Undo','Redo','-','TextColor','BGColor'] ] });
Attachments (3)
Change History (13)
Changed 14 years ago by
Attachment: | 6144.patch added |
---|
comment:1 Changed 14 years ago by
Status: | new → confirmed |
---|---|
Version: | 3.4.1 (SVN - trunk) → 3.0 |
Your patch is not correct though as it ruins the default toolbar.
comment:3 Changed 14 years ago by
Floating always makes me nervous, but it appears to work in IE 7,8 FF 3 and Chrome 5. It's one of the only ways to get around the stupid collapsing margins bug.
comment:4 Changed 14 years ago by
comment:5 Changed 14 years ago by
Ahh yes, I've seen that one before too, but I can't remember out how to reproduce it at the moment. What's the toolbar code you are using there?
comment:6 Changed 14 years ago by
Okay, so -- there are two different ways to specify which items on a toolbar are next to each other.
This is the default toolbar:
['Source','-','Save','NewPage','Preview','-','Templates'], ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'], '/', ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Anchor'], ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'], '/', ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['Maximize', 'ShowBlocks','-','About']
This is a different way of visually getting the same thing:
['Source'],['Save','NewPage','Preview'],['Templates'], ['Cut','Copy','Paste','PasteText','PasteFromWord'],['Print', 'SpellChecker', 'Scayt'], ['Undo','Redo'],['Find','Replace'],['SelectAll','RemoveFormat'], ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'], '/', ['Bold','Italic','Underline','Strike'],['Subscript','Superscript'], ['NumberedList','BulletedList'],['Outdent','Indent','Blockquote','CreateDiv'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Link','Unlink','Anchor'], ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'], '/', ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['Maximize', 'ShowBlocks'],['About']
But the two different versions will handle "linebreaks" very differently. Basically, in addition to the manual linebreaks ("/"), CKEditor toolbears also break on "],[" if necessary. Because of this, even though "-" breaks up a line into different "bubbles", it DOESN'T make it okay for the toolbar to linebreak there. Make sense?
Because my editor doesn't have a fixed width, I needed to make it as flexible as possible. So I took care to break up my bubbles as much as I possibly could.
This is my toolbar:
['Source'], ['PasteFromWord'], ['Undo','Redo'], ['Find','Replace'], ['SelectAll','RemoveFormat'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['Image','Table','HorizontalRule'], ['NumberedList','BulletedList'], ['Outdent','Indent','Blockquote'], ['Link','Unlink','Anchor'], ['DWUser','DWCut','Poll'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','SpoilerDark','SpoilerLight'], ['Font'], ['FontSize'], ['TextColor'], ['BGColor'], ['Maximize','ShowBlocks']
But the important thing is how wide your editor is. I think what's causing the problem in this case is the fact that there should be an "optional" linebreak between the two richcombo boxes, and it's not working because of the float. You should be able to get the same effect, therefore, by using my toolbar and then manually resizing your editor until it looks like my screenshot.
Adding the margins as suggested in the above patch DOES fix it for me, by the way.
comment:8 Changed 14 years ago by
Owner: | set to Garry Yao |
---|---|
Status: | confirmed → review |
Summary: | RichComboBoxes in their own toolbar row produces poor CSS → rich combo in a separate looks bad |
Changed 14 years ago by
Attachment: | 6144_3.patch added |
---|
comment:9 Changed 14 years ago by
Status: | review → review_passed |
---|
comment:10 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed with [6422].
Moved the margin-bottom to a different element