Ticket #3122: 3122.patch

File 3122.patch, 1.9 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/menu/plugin.js

     
    272272                                        ' onblur="this.style.cssText = this.style.cssText;"' );
    273273                        }
    274274
     275                        var offset = ( this.offset || 0 ) * -16;
    275276                        output.push(
    276277//                                      ' onkeydown="return CKEDITOR.ui.button._.keydown(', index, ', event);"' +
    277278                                        ' onmouseover="CKEDITOR.tools.callFunction(', menu._.itemOverFn, ',', index, ');"' +
     
    279280                                        ' onclick="CKEDITOR.tools.callFunction(', menu._.itemClickFn, ',', index, ');"' +
    280281                                        '>' +
    281282                                                '<span class="cke_icon"' +
    282                                                         ( this.icon ? ' style="background-image:url(' + CKEDITOR.getUrl( this.icon ) + ');background-position:0 0;"' : '' ) +
     283                                                        ( this.icon ? ' style="background-image:url(' + CKEDITOR.getUrl( this.icon ) + ');background-position:0 ' + offset + 'px;"'
     284                                                          : '' ) +
    283285                                                        '></span>' +
    284286                                                '<span class="cke_label">' );
    285287
  • _source/plugins/button/plugin.js

     
    5656        this.className = definition.className || ( definition.command && 'cke_button_' + definition.command ) || '';
    5757
    5858        this.icon = definition.icon;
     59        this.offset = definition.offset;
    5960
    6061        /**
    6162         * The function to be called when the user clicks the button. If not
     
    179180                                        '<span class="cke_icon"' );
    180181
    181182                if ( this.icon )
    182                         output.push( ' style="background-image:url(', CKEDITOR.getUrl( this.icon ), ');background-position:0 0;"' );
     183                {
     184                        var offset = ( this.offset || 0 ) * -16;
     185                        output.push( ' style="background-image:url(', CKEDITOR.getUrl( this.icon ), ');background-position:0 ' + offset + 'px;"' );
     186                }
    183187
    184188                output.push(
    185189                                        '></span>' +
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy