Ticket #2531286 (accepted enhancement)

Reporter


Robert Schultz
Opened: 10/9/11
Last modified: 09/19/12
Status: accepted
Type: enhancement

Owner


Eric Ferraiuolo
Target Release: BACKLOG
Priority: P2 (high)
Summary: 3.4.1 Panel's alignOn not centering/working with events
Description:

Create a panel, centered, with content about 70% of available window width/height
3 seconds after the panel is visible, resize the content to 30%
Fire a custom event that the panel is configured to listen to in the 'alignOn' attribute.

It should automatically re-position itself in the center of the screen at this point.

In 3.4.0 this works perfectly. In 3.4.1 it doesn't. If you call myPanel.align() in 3.4.1 this does work, as a work-around.

Here is test case code. Note the only difference between these two links is one is including 3.4.0 files, the other 3.4.1:

3.4.0 : Works
http://jsfiddle.net/Y3P3b/

3.4.1 : Broken
http://jsfiddle.net/QeVys/

Type: enhancement Observed in Version: 3.4.1
Component: Panel Severity: S3 (normal)
Assigned To: Eric Ferraiuolo Target Release: BACKLOG
Location: Library Code Priority: P2 (high)
Tags: Relates To:
Browsers: N/A
URL: http://jsfiddle.net/QeVys/1/
Test Information:

Change History

Robert Schultz

Posted: 10/9/11
  • testurl changed from http://jsfiddle.net/QeVys/ to http://jsfiddle.net/QeVys/1/

Updated the jsfiddle example, use these links instead of the original bug description ones:

3.4.0 Works:
http://jsfiddle.net/Y3P3b/1/

3.4.1 Broken:
http://jsfiddle.net/QeVys/1/

Eric Ferraiuolo

YUI Developer

Posted: 10/10/11
  • priority changed to P3 (normal)
  • status changed from new to accepted

The `alignOn` attribute is only suppose to work with Y.Node instances, in 3.4.0 the you could not pass a selector string to the `alignOn` config, but in 3.4.1 you now can. The result of this change means that the `alignOn` config's `node` property is being passed through `Y.one()`. In your example you are not passing in a Y.Node reference, therefore it will default to the widget's `boundingBox`. In 3.5.0 the plan is to add better custom event support for `alignOn`.

http://yuilibrary.com/yui/docs/api/classes/WidgetPositionAlign.html#attr_alignOn

The other was you could deal with this in your code, is pass a node reference into your `alignOn` config and since Y.Nodes are EventTargets you can call `fire()` on a node instance. I would recommend just calling the `align()` (with no arguments) method on the widget though.

Eric Ferraiuolo

YUI Developer

Posted: 10/10/11
  • location changed to Library Code
  • milestone changed to 3.5.0
  • type changed from defect to enhancement

Adding to 3.5.0 and tracking as an enhancement for custom event support for the `alignOn` attribute.

Eric Ferraiuolo

YUI Developer

Posted: 10/10/11
  • estimated changed from 0 to 1
  • remaining changed from 0 to 1
  • sprint changed to sprint 3

Eric Ferraiuolo

YUI Developer

Posted: 11/7/11
  • estimated changed from 1 to 0.5
  • remaining changed from 1 to 0.5
  • severity changed from S3 (normal) to S2 (high)
  • sprint changed from sprint 3 to sprint 1

Eric Ferraiuolo

YUI Developer

Posted: 11/7/11
  • priority changed from P3 (normal) to P2 (high)
  • severity changed from S2 (high) to S3 (normal)

Eric Ferraiuolo

YUI Developer

Posted: 11/9/11
  • sprint changed from sprint 1 to sprint 2

Eric Ferraiuolo

YUI Developer

Posted: 12/14/11
  • sprint changed from sprint 2 to sprint 3

Eric Ferraiuolo

YUI Developer

Posted: 01/31/12
  • milestone changed from 3.5.0 to 3.6.0

Eric Ferraiuolo

YUI Developer

Posted: 01/31/12

Punting

Eric Ferraiuolo

YUI Developer

Posted: 04/9/12
  • sprint changed from sprint 3 to backlog

Robert Schultz

Posted: 04/9/12

By the way, I'd be ok with this being closed as 'invalid' or 'wontfix' as the bug was opened with invalid code on my part, the workaround is the correct way of doing things :)

Eric Ferraiuolo

YUI Developer

Posted: 07/9/12
  • milestone changed from 3.6.0 to 3.NEXT
  • sprint changed from backlog

Jenny Donnelly

YUI Developer

Posted: 09/19/12
  • milestone changed from 3.NEXT to BACKLOG

Moving from 3.NEXT to BACKLOG.