[ 4 posts ]

mingfai

  • Joined: Mon Dec 15, 2008 6:58 pm
  • Posts: 22
  • Offline
  • Profile

curious about the YUI3 Overlay changes from YUI2

Post Posted: Tue Jun 30, 2009 7:20 pm
+0-
hi,

Just curious why:
1. the overlay HTML structure class name are changed from "bd" to "yui-widget-bd"? is it for backward compatibility so old YUI2 module and YUI3 overlay could co-exist?

2. In YUI3, there is no longer a Module component. I have just encountered a case that I wish to make a module that use a "flow layout", i.e. doesn't position absolutely nor align to any other element. is there a plan to support this use case? or is there a chance to make an overlay to use flow position but not absolute position?

Eric Ferraiuolo

YUI Developer

  • Username: ericf
  • Joined: Mon Jan 12, 2009 8:26 pm
  • Posts: 380
  • Location: Boston, MA
  • Twitter: ericf
  • GitHub: ericf
  • Gists: ericf
  • IRC: eric_f
  • YUI Developer
  • Offline
  • Profile

Re: curious about the YUI3 Overlay changes from YUI2

Post Posted: Tue Jun 30, 2009 8:02 pm
+0-
Overlay is effectively a namespaced built (Y.Base.build) Widget with extensions. The ClassNameManager class is used by Widget and all subclasses to generate the class-names. Since Overlay is just a Widget with Widget Extensions: WidgetPosition, WidgetPositionExt, WidgetStack, WidgetStdMod; it has the classes "yui-widget-xxx".

The Widget Class is a base class for all UI widgets to extend from. You could yourself build a custom Class based on Widget and the WidgetStdMod extension to create what you're looking for.

Code:
var MyModule = Y.Base.build('mymodule', Y.Widget, [Y.WidgetStdMod]);

Satyen Desai

YUI Developer

  • Username: sdesai
  • Joined: Tue Dec 09, 2008 4:17 pm
  • Posts: 302
  • GitHub: sdesai
  • Gists: sdesai
  • YUI Developer
  • Offline
  • Profile

Re: curious about the YUI3 Overlay changes from YUI2

Post Posted: Wed Jul 01, 2009 1:05 pm
+2-
Hey mingfai,

Answers below...

> 1. the overlay HTML structure class name are changed from "bd" to "yui-widget-bd"?

"bd" was too generic. It would conflict with both rules for non YUI "bd" elements, as well as "bd" elements defined by other components. That's what prompted to "yui" and "widget" prefix. Other specialized components could replace "widget" with their particular component name (e.g. yui-datatable-bd)


> 2. In YUI3, there is no longer a Module component.

As Eric mentions, you can build one using a custom mix of extensions, so you're not bound to all the features of any one class. e.g.:

http://developer.yahoo.com/yui/3/exampl ... build.html

We will probably end up packaging a statically (or relatively) positioned "Module" out of the box - but it would effectively be the same as the class built from a custom mix of extensions above.

Satyen

p.s. I sent this response as an email reply to the forum also, so you may see duplicate responses

Eric Ferraiuolo

YUI Developer

  • Username: ericf
  • Joined: Mon Jan 12, 2009 8:26 pm
  • Posts: 380
  • Location: Boston, MA
  • Twitter: ericf
  • GitHub: ericf
  • Gists: ericf
  • IRC: eric_f
  • YUI Developer
  • Offline
  • Profile

Re: curious about the YUI3 Overlay changes from YUI2

Post Posted: Wed Jul 01, 2009 1:14 pm
+0-
Forgot how good you guys are with the Documentation site; that's a perfect Example page for this topic.
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum