Opened 15 years ago

Closed 12 years ago

#2894 closed Bug (wontfix)

GetParentElement wrongly gives body sometimes for ff and webkit

Reported by: Paul Moers Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.6.4
Keywords: Cc:

Description

GetParentElement in Firefox and webkit wrongly returns the body as parent element when the cursor is simply placed inside a div without an object selected or without the cursor in or bordering text (possibly only when there's no text in the div).

A fix is as following (code assumes to be inside a dialog):

var dialog = window.parent;
var editorWindow = dialog.InnerDialogLoaded();
var editorInstance = editorWindow.FCK;

selectedElement = editorWindow.FCKSelection.GetParentElement();
if (selectedElement.tagName.toLowerCase() == 'body' && editorInstance.EditorWindow.getSelection)
{
	var selection = editorInstance.EditorWindow.getSelection();
	selectedElement = selection.anchorNode;
}

Change History (1)

comment:1 Changed 12 years ago by Jakub Ś

Resolution: wontfix
Status: newclosed

FCKeditor was retired and is no longer supported. All active development was moved to its successor, CKEditor 3.x, that is a fully mature and far superior product. We recommend you upgrade as soon as possible.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy