Opened 9 years ago

Closed 9 years ago

#11419 closed defect (duplicate)

SplitContainer: only resizes in FF 2 or 3 times before freezing

Reported by: jpsykes Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.2.0
Keywords: Cc:
Blocked By: Blocking:

Description

SlideContainer? widget in an implementation was being observed that it would resize 2-5 times and then just freeze. the bar was still clickable, but you couldn't drag it up or down, it just froze.

Attachments (1)

splitContainer.diff (942 bytes) - added by jpsykes 9 years ago.
SplitContainer? Fix Diff file

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by jpsykes

The issue is that in dijit.layout.SplitContainer?.beginSizing there are two tests for a variable, the test is looking for undefined, but rather than looking for typeof undefined, it just tests for foo. The problem occurs in that sometimes after a resize that value might be zero, zero is an accepted value, but gets interpreted as undefined, and the script falls to pieces. It results in a whole series of NaN's that prevent the slider from functioning again. A fix was found to be just changing:

--- Original Dojo 1.2.0 +++ Fix for split container freeze bug @@ -24,18 +24,16 @@

TODO: REVISIT - we want MARGIN_BOX and core hasn't exposed that yet (but can't we use it anyway if we pay attention? we do elsewhere.) this.originPos = dojo.coords(children[0].domNode, true); if(this.isHorizontal){

+ var client = (typeof e.layerX === 'undefined') ? e.offsetX : e.layerX;

  • var client = (e.layerX ? e.layerX : e.offsetX);

var screen = e.pageX; this.originPos = this.originPos.x;

}else{

+ var client = (typeof e.layerY === 'undefined') ? e.offsetY : e.layerY;

  • var client = (e.layerY ? e.layerY : e.offsetY);

var screen = e.pageY; this.originPos = this.originPos.y;

} this.startPoint = this.lastPoint = screen; this.screenToClientOffset = screen - client; this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position;

if(!this.activeSizing){

I know this is old and deprecated code, but I wanted to post it here incase someone else has a similar issue and came here to see if there was a solution.

Changed 9 years ago by jpsykes

Attachment: splitContainer.diff added

SplitContainer? Fix Diff file

comment:2 Changed 9 years ago by jpsykes

Garbled the code in the above comment, so I've attached the diff.

comment:3 Changed 9 years ago by jpsykes

Further info. It's fixed in the 1.4.3 version using this code.

if(this.isHorizontal){

var client = e.layerX
e.offsetX 0;

var screen = e.pageX; this.originPos = this.originPos.x;

}else{

var client = e.layerY
e.offsetY 0;

var screen = e.pageY; this.originPos = this.originPos.y;

}

comment:4 Changed 9 years ago by bill

Resolution: duplicate
Status: newclosed
Summary: slideContainer only resizes in FF 2 or 3 times before freezingSplitContainer: only resizes in FF 2 or 3 times before freezing

Dup of #7424.

Note: See TracTickets for help on using tickets.