#36 closed Bug (fixed)
bug in FCKTools.GetParentWindow
Reported by: | Alfonso Martínez de Lizarrondo | Owned by: | Alfonso Martínez de Lizarrondo |
---|---|---|---|
Priority: | Normal | Milestone: | FCKeditor 2.4 |
Component: | General | Version: | |
Keywords: | Cc: |
Description (last modified by )
I've run the automated test (first I've had to patch the test files adding a
FCKScriptLoader._FCKeditorPath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_test')) ;
so it does work in any directory) and then I've found that Firefox had an error in FCKTools.GetParentWindow I've looked at it and I think that it was wrong because it tries to use document.contentWindow but contentWindow is a property of an iframe, it doesn't point to the parent window of the document in any browser. Instead I've changed to
FCKTools.GetParentWindow = function( document ) { return document.parentWindow ? document.parentWindow : document.defaultView ; }
That should work in IE, Firefox and Opera.
All of these changes are in my development branch
Change History (6)
comment:1 Changed 18 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 18 years ago by
comment:3 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
If you merge your branch with the latest trunk, you will see that I've fixed it (before you have opened the ticket). Maybe you will have some conflicts there.
As you have noted, there was a duplication. I've removed GetParentWindow.
comment:4 Changed 18 years ago by
I see that you have changed the code, but the FCKTools.GetParentWindow still does exist.
I'll leave your code, but I don't really understand what it does because as I said a document doesn't have a contentWindow property in any browser.
comment:5 Changed 18 years ago by
Sorry Alfonso... I did some mistake. Actually the function was still there, and it was still used somewhere else.
I've just committed the correct fix. Thanks for the advice.
comment:6 Changed 18 years ago by
Milestone: | → FCKeditor 2.4 |
---|
I was reviewing again this and seems that the only place where this function is called is in FCKPanel.prototype.CreateChildPanel and with the proposed change now FCKTools.GetParentWindow behaves like FCKTools.GetDocumentWindow so it wouldn't be neccesary.