PDA

View Full Version : Little things...



stever
3 Apr 2007, 12:00 PM
In basic dialog, it would be cool if for x and y we could pass negative numbers and they would position from the right and bottom in those cases.
Long menus should scroll.
In another menu library we use, it has the option to "clone" a menu. Say we have a forum like this one, and in every message in a thread view (which can be a lot) we have the same menu (different items may be enabled depending on which one, but that can be done just before the menu is shown). There can be 30+ copies of the menu HTML. I don't know if your version works that way too, but if it does, the clone idea is great since it reduces the memory footprint. I'm not sure what the savings really is, but I thought I'd bring it as food for thought.

jack.slocum
3 Apr 2007, 12:59 PM
1. Unfortunately negative are actually valid coordinates. However, I have added to function which may be better:

dialog.alignTo
Similar to Element.alignTo, this function is very flexible for aligning elements dynamically. To align with the viewport, just pass in the document or body element. e.g.

dialog.alignTo(document, 'br-br');

That would align to bottom right corner of the dialog with the bottom right corner of the viewport. The third parameter offsets allows you to set margins on that alignment.

dialog.anchorTo

Same as above only maintains it when the window resizes and (optionally) when the body scrolls.

dialog.anchorTo(document, 't-t', [0,10], true);

That would align the dialog top with the viewport top, centered (because no corners are given) and maintain it anytime the window is resized or scrolled.

These changes are in SVN.

jack.slocum
3 Apr 2007, 1:01 PM
I Forgot:

2. Is on the list for 1.1.

3. I would heavily recommend sharing the same menu, no cloning. This is how desktop systems work as well. Is there any reason they would need a unique menu?

stever
3 Apr 2007, 1:56 PM
1. Very cool. Even better than my suggestion!
2. Glad to hear, will be useful!
3. I get it, I just didn't notice that you could reference an already defined menu structure. I see it in the examples now... just what i was looking for. Thanks!