#2894: GetParentElement wrongly gives body sometimes for ff and webkit
---------------------+------------------------------------------------------
Reporter: saul11 | Owner:
Type: Bug | Status: new
Priority: Normal | Milestone:
Component: General | Version: FCKeditor 2.6.4
Keywords: |
---------------------+------------------------------------------------------
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;
}
}}}
--
Ticket URL: <http://dev.fckeditor.net/ticket/2894>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac