Opened 6 years ago

Closed 3 years ago

#2894 closed Bug (wontfix)

GetParentElement wrongly gives body sometimes for ff and webkit

Reported by: saul11 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 3 years ago by j.swiderski

  • Resolution set to wontfix
  • Status changed from new to closed

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 – 2015 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy