Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#883 closed defect (fixed)

[patch] Opera: resizing fails in test_SplitContainer.html

Reported by: adam@… Owned by: bill
Priority: high Milestone:
Component: Events Version: 0.3
Keywords: Cc: adam@…
Blocked By: Blocking:

Description

tests/widget/test_SplitContainer.html

Drag separators and nothing happens

Change History (10)

comment:1 Changed 13 years ago by anonymous

SplitContainer?.beginSizing() is using layerX and layerY properties of the mousedown event which are not supported in Opera (http://www.quirksmode.org/dom/w3c_events.html#mousepos).

comment:2 Changed 13 years ago by anonymous

My suggestion is to fix in event.browser.fixEvent(), since there is already code to do the same for IE. Or just fix it in SplitContainer the same way. Suggested patch follows:

sjs@cobra:~/devel/ajax/dojo$ svn diff src/event/browser.js
Index: src/event/browser.js
===================================================================
--- src/event/browser.js        (revision 4242)
+++ src/event/browser.js        (working copy)
@@ -230,11 +230,12 @@
                        }
                }

+               if(!evt.layerX && evt.offsetX) { evt.layerX = evt.offsetX; }
+               if(!evt.layerY && evt.offsetY) { evt.layerY = evt.offsetY; }
+
                if(dojo.render.html.ie){
                        if(!evt.target){ evt.target = evt.srcElement; }
                        if(!evt.currentTarget){ evt.currentTarget = (sender ? sender : evt.srcElement); }
-                       if(!evt.layerX){ evt.layerX = evt.offsetX; }
-                       if(!evt.layerY){ evt.layerY = evt.offsetY; }
                        // FIXME: scroll position query is duped from dojo.html to avoid dependency on that entire module
                        if(!evt.pageX){ evt.pageX = evt.clientX + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0) }
                        if(!evt.pageY){ evt.pageY = evt.clientY + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0) }
sjs@cobra:~/devel/ajax/dojo$

comment:3 Changed 13 years ago by adam@…

Cc: adam@… added

Unfortunately, this makes things much worse on Opera. With this change, the layout is completely messed up. The sliders are all the way up and to the left respectively in the two boxes, overlaying each other and still unable to be dragged.

comment:4 Changed 13 years ago by sjs@…

Adam,

Clear cookies and that problem will go away. That container uses cookies to save slider position, but the cookies end up with bogus values and screw things up thereafter.

I don't suggest that fix is pixel perfect though. It looked to me like it offsetX matches layerX 1 to 1 only as long as the element has no padding/margins. Some adjustment probably needs to happen otherwise, but I don't have time (or interest) to delve in that deep at the moment.

Cheers, Stephen

comment:5 Changed 13 years ago by adam@…

Thanks, Stephen. Much better!

comment:6 Changed 13 years ago by anonymous

Owner: changed from anonymous to bill

comment:7 Changed 13 years ago by dylan

Component: GeneralEvents
Milestone: 0.4
Summary: Opera: resizing fails in test_SplitContainer.html[patch] Opera: resizing fails in test_SplitContainer.html

has a patch, bumping to 0.4 as this should be an easy merge

comment:8 Changed 13 years ago by doughays@…

This is fixed by the patch included for #173.

comment:9 Changed 13 years ago by bill

Resolution: fixed
Status: newclosed

(In [5631]) Fixes #173 - just clicking a splitter makes it move 1px Fixes #391 - splitContainer panels sometimes have undesired scrollbars Fixes #883 - opera: resizing fails in test_SplitContainer.html

Patch from Doug (IBM, CCLA on file)

Also, I changed activeResize to be true/false rather than 0/1. Because we're not programming in C anymore. :-)

comment:10 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.