Ticket #2894 (closed Bug: wontfix)

Opened 5 years ago

Last modified 20 months ago

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

comment:1 Changed 20 months ago by j.swiderski

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

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