Changeset 885


Ignore:
Timestamp:
09/26/2007 11:44:11 PM (8 years ago)
Author:
alfonsoml
Message:

Fix for #1299, pass the reference to the FCKTextColorCommand.SetColor keeping the reference to 'this'

Location:
FCKeditor/trunk/editor/_source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/commandclasses/fcktextcolorcommand.js

    r828 r885  
    100100        this.className = 'ColorDeselected' ;
    101101        command._Panel.Hide() ;
    102         FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, command.SetColor ) ;
     102        FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, FCKTools.Hitch(command, 'SetColor') ) ;
    103103}
    104104
  • FCKeditor/trunk/editor/_source/internals/fcktools.js

    r774 r885  
    574574        return tempSpan.style.cssText ;
    575575}
     576
     577/**
     578 * Utility function to wrap a call to an object's method,
     579 * so it can be passed for example to an event handler,
     580 * and then it will be executed with 'this' being the object.
     581 */
     582FCKTools.Hitch = function( obj, methodName )
     583{
     584  return function() { obj[methodName].apply(obj, arguments); } ;
     585}
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy