I am working with FCKeditor and experience an Internet Explorer specific bug with the insertion point. I need a way to save/restore the insertion point (and current selection) in IE6, or to disable the movement of it temporarily.
The reason is that clicks in a modal dialog box above end up clicking through and moving the insertion point in the rich text editor. Then when you hit Ok on the dialog, the action gets done in the wrong place.
Thanks.
The reason is that clicks in a modal dialog box above end up clicking through and moving the insertion point in the rich text editor. Then when you hit Ok on the dialog, the action gets done in the wrong place.
Thanks.
RE: Saving/restoring Insertion point in IE
Code for what I have so far (added to fckselection_ie.js):
// custom functions to save selection to handle IE-click through issue in modal dialoges -nj
FCKSelection.Save = function()
{
if ( this.GetType() == 'Control' )
{
this.saved = 'node';
this.oSavedNode = FCKSelection.GetSelectedElement();
}
else if( this.GetType() == 'Text' )
{
this.saved = 'range';
this.oSavedRange = FCK.EditorDocument.selection.createRange();
}
}
FCKSelection.Restore = function()
{
if( this.saved && this.saved == 'node' )
{
FCKSelection.SelectNode(this.oSavedNode);
}
else if( this.saved && this.saved == 'range' )
{
this.oSavedRange.select();
}
}