Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callbacks that pass serialized event objects project (left,top) on (x,y) which is counter-intuitive #715

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

A callback such as #callbackDraggable: passes a serialized event object where 
the #offset parameter is aCoordinate instance. This instance has the 'left' 
value as the 'y' coordinate and 'top' value as the 'x' coordinate.

I would expect 'top' to project to 'y' and 'left' to 'x'

Obviously, this would break existing code, so maybe the best fix is to pass a 
dictionary with #top and #left.

(I'm willing to fix that, but I would first want to make sure what the core 
developers think it should be ;-)

Original issue reported on code.google.com by johanbri...@gmail.com on 20 Feb 2012 at 3:29

@GoogleCodeExporter
Copy link
Author

Original comment by philippe...@gmail.com on 20 Feb 2012 at 5:35

  • Added labels: JQuery
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Certainly sounds wrong from your description - personally I'd vote for breaking 
old code (with an appropriate notice in the version notes) unless you think a 
dictionary is actually a better solution. But I'd be interested to hear Lukas' 
opinion as to whether it was a bug or not...

Original comment by jfitz...@gmail.com on 21 Feb 2012 at 5:12

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Hi all. Just  for extend information about the bug, I copy here the email I 
sent yesterday to the list. 
http://forum.world.st/Incorrect-position-en-JQDialog-td4399806.html

I guess that the JQWDialog is inconsistent informing the position of dialog in 
position: and onDragStop: methods.
I check in Seaside-3.0.6-OneClick and 
http://jenkins.lukas-renggli.ch/job/Seaside%203.0/lastSuccessfulBuild/artifact/S
easide-3.0-OneClick.zip

To reproduce the problem:

1) Add position instance variable to JQUiFunctionalTest and modify 
>>renderWindowOn: to look like this :

script: (html jQuery new dialog
     position: position;      "line added"
    onDragStop: (html jQuery ajax callbackDraggable: [ :event |       " line added"
        position := (event at: #position). position inspect ]);      "line added"
     title: 'Vegetables';
    autoOpen: false;
    addButton: 'Close' do: html jQuery new dialog close);
    with: [ html unorderedList list: self vegetables ].

2) Go to http://localhost:8080/javascript/jquery-ui/dialogwidget
3) Press button Open Window and move de Dialog to bottom-left corner.
4) Refresh the page and press again button Open Window

The dialog show with de left-top attributes changed each other.

If you see the position in inspector that is opened when drag stop, the 
callbackDraggable: inform top@left, but in the comment of JQDialog>>position: 
method say that left@top are expected as parameter:
" 2) an array containing an x,y coordinate pair in pixel offset from left, top 
corner of viewport (e.g. [350,100]) "

The fact, if you change the coordinates of position with transposed the problem 
is solved:
onDragStop: (html jQuery ajax callbackDraggable: [ :event |
        position := (event at: #position) transposed. position inspect ]);

And the same problem in onResizeStop with the position (I have split the 
coordinates for size). Add width and height ivars and next code for reproduce 
problem:
 width: width;
 height: height;
 onResizeStop: (html jQuery ajax callbackResizable: [ :event | 
     position := event at: #position.
     width := (event at: #size) x.
     height := (event at: #size) y ]); 


I look at JQDialog API and I see that left@top that say in position: method is 
fine:
http://docs.jquery.com/UI/Dialog#option-position

Maybe the callbacks are bad for position?

Original comment by gaston.d...@gmail.com on 21 Feb 2012 at 8:38

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by jo...@yesplan.be on 16 Jun 2014 at 9:51

  • Added labels: Milestone-3.2
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Original comment by jo...@yesplan.be on 11 Oct 2014 at 10:15

  • Changed state: Started
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Name: JQuery-UI-JohanBrichau.92
Author: JohanBrichau
Time: 19 October 2014, 7:50:33.534425 pm
UUID: 0ec8f821-5964-40c8-b889-9f79b1534bc5
Ancestors: JQuery-UI-JohanBrichau.91

callbacks that pass serialized event objects project (left,top) on (x,y) which 
is counter-intuitive (https://code.google.com/p/seaside/issues/detail?id=715)

Original comment by jo...@yesplan.be on 19 Oct 2014 at 5:51

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant