|
|
|
[
Permlink
| « Hide
]
Josh Crowley - 06/Jul/07 02:33 AM
Weird. This was something Max had fixed, having to do with how DHTML apps are embedded in pages in IE.
I've managed to narrow this one down. It's a problem with calling LzFocus.setFocus() on something outside the viewable canvas area in DHTML. Try running the following test case in DHTML:
<canvas width="400" height="600"> <view width="${canvas.hat.expanded ? 265 : 390}" x="5" height="550" y="5" bgcolor="0x00FF00"> <button width="10" height="10" x="30" y="30"> <handler name="onclick"> canvas.hat.setAttribute('expanded', !canvas.hat.expanded); </handler> </button> </view> <view name="hat" width="120" x="400" height="550" y="5" bgcolor="0xFF00FF"> <attribute name="expanded" type="boolean" value="false"/> <event name="onexpanded"/> <handler name="onexpanded"> if(this.expanded == true){ this.slideit.doStart(); } else { this.slideback.doStart(); } LzFocus.setFocus(this.focustext); </handler> <edittext name="focustext" width="${parent.width - 20}" x="10" text="Focus on me."/> <animator name="slideit" attribute="x" from="400" to="280" duration="5000" start="false"/> <animator name="slideback" attribute="x" from="280" to="400" duration="5000" start="false"/> </view> </canvas> Clicking the button will, for some reason, shift the visible canvas area over to whatever is being focused on off-canvas. The culprit in this case (the Calendar) was: LzFocus.setFocus(summary.content.title); Commenting this line out resulted in no weird shifting in the app. Weird... I'll probably use a workaround on this particular case, where I call LzFocus.setFocus(); in the onstop of one of the expanding animators, to be sure it's not called until the object is fully on canvas. I'm going to create a new bug, though, for Max, addressing this larger issue. Approved by Phil. Checkin transcript follows:
Author: jcrowley Date: 2007-09-28 13:26:36 -0700 (Fri, 28 Sep 2007) New Revision: 6676 Modified: openlaszlo/trunk/demos/calendar/infopanel.lzx Log: Change 20070928-jcrowley-u by jcrowley@doctormanhattan.mshome.net on 2007-09-28 16:24:50 EDT in /Users/jcrowley/src/svn/openlaszlo/trunk-a for http://svn.openlaszlo.org/openlaszlo/trunk Summary: [repackaging for trunk - this was approved by Phil] DHTML calendar demo wigs out on opening Event Info New Features: Bugs Fixed: Event Info Technical Reviewer: pbr QA Reviewer: max Doc Reviewer: Documentation: Release Notes: Details: I found a larger bug with this one, which was auto- assigned to Tucker. It's LPP-4499. The issue here is really that calling LzFocus.setFocus() on something off-canvas in DHTML will slide the canvas over so that the focused item is visible. I worked around it in this case by moving it into an onstop event for one of the animators called by the same method, to ensure it didn't get called until after the object was fully on-screen. Tests: Run modified Calendar versus unmodified in DHTML; note the modified version doesn't slide over all crazy-like when the info panel is opened by clicking the 'i' on a selected event tag. Modified: openlaszlo/trunk/demos/calendar/infopanel.lzx =================================================================== --- openlaszlo/trunk/demos/calendar/infopanel.lzx 2007-09-28 20:26:11 UTC (rev 6675) +++ openlaszlo/trunk/demos/calendar/infopanel.lzx 2007-09-28 20:26:36 UTC (rev 6676) @@ -280,7 +280,7 @@ <animator start="false" name="slideopen1old" attribute="width" to="204" duration="500" relative="false"/> <animator start="false" name="slideopen1" attribute="x" to="602" from="830" - duration="500"/> + duration="500" onstop="LzFocus.setFocus(parent.summary.content.title);"/> <animator start="false" name="slideopen2" attribute="opacity" to="1" from="0" duration="500" relative="false"/> @@ -319,7 +319,6 @@ this.setOpacity(1); this.slideopen1.doStart(); this.slideopen2.doStart(); - LzFocus.setFocus(summary.content.title); this.opened = true; </method> This is now also checked into Jujube, as revision 6682. Approved by Phil. Transcript follows:
Author: jcrowley Date: 2007-09-28 14:49:13 -0700 (Fri, 28 Sep 2007) New Revision: 6682 Modified: openlaszlo/branches/wafflecone/demos/calendar/infopanel.lzx Log: Change 20070928-jcrowley-u by jcrowley@doctormanhattan.mshome.net on 2007-09-28 17:07:30 EDT in /Users/jcrowley/src/svn/openlaszlo/wafflejujube for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone Summary: [this has been fixed in trunk; Amy wants this integrated into Jujube] HAND-MERGE: DHTML calendar demo wigs out on opening Event Info New Features: Bugs Fixed: Technical Reviewer: pbr QA Reviewer: max Doc Reviewer: Documentation: Release Notes: Details: Hand-merging r6676 from trunk into jujube. Tests: Run modified Calendar versus unmodified in DHTML; note the modified version doesn't slide over all crazy-like when the info panel is opened by clicking the 'i' on a selected event tag. Modified: openlaszlo/branches/wafflecone/demos/calendar/infopanel.lzx =================================================================== --- openlaszlo/branches/wafflecone/demos/calendar/infopanel.lzx 2007-09-28 21:13:02 UTC (rev 6681) +++ openlaszlo/branches/wafflecone/demos/calendar/infopanel.lzx 2007-09-28 21:49:13 UTC (rev 6682) @@ -280,7 +280,7 @@ <animator start="false" name="slideopen1old" attribute="width" to="204" duration="500" relative="false"/> <animator start="false" name="slideopen1" attribute="x" to="602" from="830" - duration="500"/> + duration="500" onstop="LzFocus.setFocus(parent.summary.content.title);"/> <animator start="false" name="slideopen2" attribute="opacity" to="1" from="0" duration="500" relative="false"/> @@ -319,7 +319,6 @@ this.setOpacity(1); this.slideopen1.doStart(); this.slideopen2.doStart(); - LzFocus.setFocus(summary.content.title); this.opened = true; </method> I was wrong. This has been verified against the Calendar, and the bad behavior does NOT occur.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||