Closed GoogleCodeExporter closed 8 years ago
See code fix below, tested in FF 3.5.3 and IE 7
/**
* The JavaScript code to call to insert the function that hides a Div in the
DOM.
*/
public static var INSERT_FUNCTION_HIDEDIV:String =
"document.insertScript = function ()" +
"{ " +
"if (document." + FUNCTION_HIDEDIV + "==null)" +
"{" +
FUNCTION_HIDEDIV + " = function (frameID)" +
"{" +
"document.getElementById(frameID).focus();" +
"document.getElementById(frameID).style.display='none';" +
"}" +
"}" +
"}";
public static var INSERT_FUNCTION_HIDEIFRAME:String =
"document.insertScript = function ()" +
"{ " +
"if (document." + FUNCTION_HIDEIFRAME + "==null)" +
"{" +
FUNCTION_HIDEIFRAME + " = function (frameID, iframeID)" +
"{" +
"var iframeRef = document.getElementById(iframeID);" +
"alert('Hiding iframe');" +
"var iframeDoc;" +
"if (iframeRef.contentWindow) {" +
"iframeDoc = iframeRef.contentWindow.document;" +
"} else if (iframeRef.contentDocument) {" +
"iframeDoc = iframeRef.contentDocument;" +
"} else if (iframeRef.document) {" +
"iframeDoc = iframeRef.document;" +
"}" +
"if (iframeDoc) {" +
"iframeDoc.body.style.display = 'none';" +
"}" +
"document.getElementById(frameID).style.display = 'none';" +
"document.getElementById(frameID).focus();" +
"}" +
"}" +
"}";
Original comment by andrei.i...@gmail.com
on 30 Dec 2009 at 11:45
Hi Andrei, is there a reason why you call focus() in the hide methods ? It looks
cleaner to me to have it in the show methods. Did you test this way ?
Original comment by Julien.N...@gmail.com
on 30 Dec 2009 at 3:47
Hi Julien,
Why would you want to call it on show?
I think the flow is following unless I am wrong:
IFrame destroyed by any means e.g. removed from stage, hide is called and it's
focused to remove blinking cursor. I am not sure if show called in following
scenario: I have Iframe1(with cursor) and IFrame2, when I switch to IFrame2
e.g.
calling visible = true on IFrame2 and visible false on IFrame1. If focus() is
done
in show, cursor from IFrame1 will still stay blinking.
Original comment by andrei.i...@gmail.com
on 30 Dec 2009 at 4:08
No, because the focus will have been set on IFrame2.
It is not very logical to set the focus on an element you are hiding...
Original comment by Julien.N...@gmail.com
on 30 Dec 2009 at 4:20
Oh right, did not think about it, I guess this would work as well
Original comment by andrei.i...@gmail.com
on 30 Dec 2009 at 4:33
On the second thought, I still think it meeds to be called at hide. The reason
for
this - tabnavigator can have second tab opened as flex tab.
E.g. Open Iframe tab 1 with input focused and when open tab 2 which is
completely
flex. When try switching between them (with focusing input in tab1), cursor
will
stay on flex tab 2.
Original comment by andrei.i...@gmail.com
on 30 Dec 2009 at 7:15
Looks somehow fixed in 1.4.5.
Original comment by Julien.N...@gmail.com
on 14 May 2010 at 4:51
Original issue reported on code.google.com by
andrei.i...@gmail.com
on 29 Dec 2009 at 4:23