#171 fix bogus Control detection of selection in Gecko

Version 2.x
closed
Editor (144)
5
2006-06-02
2005-11-06
No

If a user selects just one char then the selection type
is wrongly assumed to be a Control (because the start
and end containers are the same one and there is just a
difference of 1 in the offset).

to fix it add another check in FCKSelection.GetType in
internals\fckselection_gecko.js:

if ( oRange.startContainer == oRange.endContainer &&
(oRange.endOffset - oRange.startOffset) == 1 &&
oRange.startContainer.nodeType != Node.TEXT_NODE )
this._Type = 'Control' ;

Maybe if could be improved checking other nodeTypes?
in my little tests this is just enough but who knows?

Discussion

  • Frederico Caldeira Knabben

    • assigned_to: nobody --> fredck
     
  • Frederico Caldeira Knabben

    Logged In: YES
    user_id=572424

    Hi,

    This patch, or a similar implementation, has been included in
    FCKeditor and has been committed in the SVN. It will be
    available in the next release.

    For more information about the FCKeditor SVN system, please use
    the following URL:
    https://sourceforge.net/svn/?group_id=75348

    Best regards,
    FredCK
    http://www.fckeditor.net
    "Support Open Source Software... What about a donation today?"

    PS.: This is a canned response.

     
  • Frederico Caldeira Knabben

    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks