Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#2152 closed defect (fixed)

dojo.lfx.wipeIn jumps at end of animation if specific contents inside

Reported by: admin@… Owned by: bill
Priority: high Milestone: 0.9
Component: lfx Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

dojo.lfx has some stange malfunctions, doesnt exist in 4.0

attaching test file

doesn't wipe in or out correctly if specific contents inside

Attachments (2)

test_case.html (1.3 KB) - added by guest 13 years ago.
dojo.lfx.html.wipeIn.patch (937 bytes) - added by guest 13 years ago.
final and CORRECT version of patch

Download all attachments as: .zip

Change History (15)

Changed 13 years ago by guest

Attachment: test_case.html added

comment:1 Changed 13 years ago by guest

seems that more widgets like tabcontainer suffer from this bug...

comment:2 Changed 13 years ago by bill

Resolution: invalid
Status: newclosed

The main problem is that your testcase is missing a dojo.require call.

<script>
	dojo.require("dojo.lfx.html");
</script>

After that it should work. Reopen the bug if it doesn't, with more specific description about what the problem is.

comment:3 Changed 13 years ago by guest

Resolution: invalid
Status: closedreopened

it not the case it doesnt work, it works.

the problem is that wiping isnt correct, just check the example, with that require its not better.

it worked ok in 4.0 and 4.1rc1 too ( but im not 100% sure )

comment:4 Changed 13 years ago by guest

the div that is wiping "skips" every time at some point and rendering getys broken, as other widgets like titlepane use wiping they have problems too. just run that in FF for example ;-)

comment:5 Changed 13 years ago by bill

Milestone: 0.5

Ah OK, that's a better description. I suspect the height that it wipes to is probably miscalculated as though the first really long sentence appears on a single line. (Try making the browser window narrower and the skip effect is magnified.)

comment:6 Changed 13 years ago by bill

Owner: changed from Bryan Forbes to bill
Status: reopenednew

comment:7 Changed 13 years ago by bill

Description: modified (diff)
Summary: dojo.lfx has some stange malfunctions, doesnt exist in 4.0dojo.lfx.wipeIn jumps at end of animation if specific contents inside

comment:8 Changed 13 years ago by admin@…

FIX:

in wipeIn function change:

	dojo.lang.forEach(nodes, function(node){
		var oprop = {  };	// old properties of node (before we mucked w/them)
		
		// get node height, either it's natural height or it's height specified via style or class attributes
		// (for FF, the node has to be (temporarily) rendered to measure height)
		// TODO: should this offscreen code be part of dojo.html, so that getBorderBox() works on hidden nodes?
		var origTop, origLeft, origPosition;
		with(node.style){
			origTop=top; origLeft=left; origPosition=position;
			top="-9999px"; left="-9999px"; position="absolute";
			display="";
		}
		var height = dojo.html.getBorderBox(node).height;

TO :

	dojo.lang.forEach(nodes, function(node){
var height = dojo.html.getBorderBox(node).height;
		var oprop = {  };	// old properties of node (before we mucked w/them)
		
		// get node height, either it's natural height or it's height specified via style or class attributes
		// (for FF, the node has to be (temporarily) rendered to measure height)
		// TODO: should this offscreen code be part of dojo.html, so that getBorderBox() works on hidden nodes?
		var origTop, origLeft, origPosition;
		with(node.style){
			origTop=top; origLeft=left; origPosition=position;
			top="-9999px"; left="-9999px"; position="absolute";
			display="";
		}
		

here is how my compressed function (and working) looks like:

dojo.lfx.html.wipeIn=function(_584,_585,_586,_587){ _584=dojo.lfx.html._byId(_584); var _588=[]; dojo.lang.forEach(_584,function(node){ move this part here from lower parts of the code ->> var _58e=dojo.html.getBorderBox(node).height;

comment:9 Changed 13 years ago by guest

diff :

-- dojo.js.uncompressed.js	2006-12-06 02:39:32.000000000 +0100
+++ dojo.js.uncompressed2.js	2007-01-15 20:14:32.406250000 +0100
@@ -9259,6 +9259,7 @@
 	var anims = [];
 
 	dojo.lang.forEach(nodes, function(node){
+		var height = dojo.html.getBorderBox(node).height;
 		var oprop = {  };	// old properties of node (before we mucked w/them)
 		
 		// get node height, either it's natural height or it's height specified via style or class attributes
@@ -9270,7 +9271,7 @@
 			top="-9999px"; left="-9999px"; position="absolute";
 			display="";
 		}
-		var height = dojo.html.getBorderBox(node).height;
+		
 		with(node.style){
 			top=origTop; left=origLeft; position=origPosition;
 			display="none";

comment:10 Changed 13 years ago by guest

sorry , the fix is wrong... it fixes the test case i attached , but it broke my live projext ...

comment:11 Changed 13 years ago by guest

ok, ive revised my previous bad patch, this one is 100% OK , tersted in test case and live project in FF, opera, IE.

here is the CORRECT fix:

--- dojo.js.uncompressed.js	2006-12-06 02:39:32.000000000 +0100
+++ dojo.js.uncompressed2.js	2007-01-15 21:48:24.843750000 +0100
@@ -9260,7 +9260,9 @@
 
 	dojo.lang.forEach(nodes, function(node){
 		var oprop = {  };	// old properties of node (before we mucked w/them)
-		
+		node.style.display='';
+		var height=dojo.html.getBorderBox(node).height;
+		node.style.display='none';
 		// get node height, either it's natural height or it's height specified via style or class attributes
 		// (for FF, the node has to be (temporarily) rendered to measure height)
 		// TODO: should this offscreen code be part of dojo.html, so that getBorderBox() works on hidden nodes?
@@ -9270,7 +9272,6 @@
 			top="-9999px"; left="-9999px"; position="absolute";
 			display="";
 		}
-		var height = dojo.html.getBorderBox(node).height;
 		with(node.style){
 			top=origTop; left=origLeft; position=origPosition;
 			display="none";

Changed 13 years ago by guest

Attachment: dojo.lfx.html.wipeIn.patch added

final and CORRECT version of patch

comment:12 Changed 13 years ago by bill

Resolution: fixed
Status: newclosed

This was already fixed in [7000]. Not sure if it's the same fix as you suggested but try the latest and see if it's working for you.

comment:13 Changed 13 years ago by admin@…

ive built the latest nightly , it appears to behave the same as in my patch ;-) seems my help was unessessary :-)

good job :]

Note: See TracTickets for help on using tickets.