Changeset 5047


Ignore:
Timestamp:
2010-02-05 17:55:33 (2 years ago)
Author:
alfonsoml
Message:

#4394 Automatically adjust the width of context menus

Location:
CKEditor/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • CKEditor/trunk/CHANGES.html

    r5045 r5047  
    8383                <li><a href="http://dev.fckeditor.net/ticket/4716">#4716</a> : [IE] Cursor remain blinking in editor when focus is moved to any button that following.</li> 
    8484                <li><a href="http://dev.fckeditor.net/ticket/5096">#5096</a> : Simple ampersand attribute value doesn't work for more than once occurance.</li> 
     85                <li><a href="http://dev.fckeditor.net/ticket/3494">#3494</a> : Context menu is too narrow in some translations.</li> 
    8586                <li>Updated the following language files:<ul> 
    8687                        <li><a href="http://dev.fckeditor.net/ticket/5006">#5006</a> : Dutch;</li> 
  • CKEditor/trunk/_source/plugins/floatpanel/plugin.js

    r4858 r5047  
    136136                                        }); 
    137137 
     138                                // To allow the context menu to decrease back their width 
     139                                element.getFirst().removeStyle('width'); 
     140 
    138141                                // Configure the IFrame blur event. Do that only once. 
    139142                                if ( !this._.blurSet ) 
     
    193196                                                var panelLoad = CKEDITOR.tools.bind( function () 
    194197                                                { 
     198                                                        var target = element.getFirst(); 
     199 
    195200                                                        if ( block.autoSize ) 
    196201                                                        { 
    197                                                                 var target = element.getFirst(); 
     202                                                                // We must adjust first the width or IE6 could include extra lines in the height computation 
     203                                                                var widthNode = block.element.$; 
     204 
     205                                                                if ( CKEDITOR.env.gecko || CKEDITOR.env.opera) 
     206                                                                        widthNode = widthNode.parentNode; 
     207 
     208                                                                if ( CKEDITOR.env.ie) 
     209                                                                        widthNode = widthNode.document.body; 
     210 
     211                                                                var width = widthNode.scrollWidth; 
     212                                                                // Account for extra height needed due to IE quirks box model bug: 
     213                                                                // http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug 
     214                                                                // (#3426) 
     215                                                                if ( CKEDITOR.env.ie && CKEDITOR.env.quirks && width > 0 ) 
     216                                                                        width += ( target.$.offsetWidth || 0 ) - ( target.$.clientWidth || 0 ); 
     217                                                                // A little extra at the end. 
     218                                                                // If not present, IE6 might break into the next line, but also it looks better this way 
     219                                                                width += 4 ; 
     220 
     221                                                                target.setStyle( 'width', width + 'px' ); 
     222 
     223                                                                // IE doesn't compute the scrollWidth if a filter is applied previously 
     224                                                                block.element.addClass( 'cke_frameLoaded') 
     225 
    198226                                                                var height = block.element.$.scrollHeight; 
    199227 
     
    210238                                                        } 
    211239                                                        else 
    212                                                                 element.getFirst().removeStyle( 'height' ); 
     240                                                                target.removeStyle( 'height' ); 
    213241 
    214242                                                        var panelElement = panel.element, 
  • CKEditor/trunk/_source/skins/kama/menu.css

    r4858 r5047  
    9595        margin-left: 24px; 
    9696        background-color: #fff; 
    97         _overflow: hidden; 
    98         _width: 80px; 
     97} 
     98/* Set these after the document has been loaded and we know the dimensions*/ 
     99.cke_skin_kama .cke_frameLoaded .cke_menuitem .cke_label 
     100{ 
    99101        filter: alpha(opacity=70); /* IE */ 
    100102        opacity: 0.70; /* Safari, Opera and Mozilla */ 
  • CKEditor/trunk/_source/skins/office2003/menu.css

    r4858 r5047  
    9494        margin-left: 24px; 
    9595        background-color: #fff; 
    96         _overflow: hidden; 
    97         _width: 80px; 
     96} 
     97/* Set these after the document has been loaded and we know the dimensions*/ 
     98.cke_skin_office2003 .cke_frameLoaded .cke_menuitem .cke_label 
     99{ 
    98100        filter: alpha(opacity=70); /* IE */ 
    99101        opacity: 0.70; /* Safari, Opera and Mozilla */ 
  • CKEditor/trunk/_source/skins/v2/menu.css

    r4858 r5047  
    9494        margin-left: 24px; 
    9595        background-color: #fff; 
    96         _overflow: hidden; 
    97         _width: 80px; 
     96} 
     97/* Set these after the document has been loaded and we know the dimensions*/ 
     98.cke_skin_v2 .cke_frameLoaded .cke_menuitem .cke_label 
     99{ 
    98100        filter: alpha(opacity=70); /* IE */ 
    99101        opacity: 0.70; /* Safari, Opera and Mozilla */ 
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2011 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy