| Page 1 of 2 | [ 12 posts ] | Go to page 1, 2 Next |
MarcYUI Contributor
|
Hi,
I'm trying to specify a gallery dependency for a YUI.add statement but can't seem to find a way to do it. I would have thought, this might do the trick: YUI.add{ //code } ,'1.0',{ gallery:['gallery-2010.05.26-19-47'], use:['overlay','gallery-overlay-extras'] } Any suggestions on this? Kind regards, Marc |
|
Code: YUI.add('usesgallery', function(Y) { // code }, '1.0.0', { requires: ['overlay','gallery-overlay-extras'] }); |
MarcYUI Contributor
|
Doesn't work for me. Overlay, yes, gallery stuff, no. I'm thinking it has something to do with the fact that I cannot specify the gallery id
|
MarcYUI Contributor
|
Hmm, it seems to work on Firefox but not on Chrome. No error messages. I'll have to dig a little further
|
MarcYUI Contributor
|
Actually, it didn't. It just worked because I placed a bit of test code on the page:
Code: YUI({ gallery: 'gallery-2010.05.12-19-08' }).use('gallery-overlay-extras', function(Y){ var fbOverlay = new Y.Overlay({ srcNode : '#fbOverlay', width : '540px', height : '300px', zIndex : 100, centered : true, constrain : true, render : true, visible : false, plugins : [ { fn: Y.Plugin.OverlayModal }, { fn: Y.Plugin.OverlayKeepaligned }, { fn: Y.Plugin.OverlayAutohide } ] }); }); The reason it doesn't worked, is that I can't specify the library id. |
|
Correct, the gallery tag is in the domain of YUI().use(), not YUI.add.
|
MarcYUI Contributor
|
Ok, that doesn't make sense to me.
I worked around it by initializing the init method with the gallery module dependent module with YUI.add('gallery_thatuses_module',function(e){}, '1.0',{ requires:['gallery_module'] }); YUI(gallery:'gallery_id').use('gallery_thatuses_module',etc{ // call init method }) But if gallery is going to be a full citizen and be directly integrated in YUI().use(), imho YUI.add function should also support it. Cheers, Marc |
MarcYUI Contributor
|
This little workaround doesn't work. Best way I found was to download the gallery items and dependencies and store them locally, then :
Code: YUI_config.groups={ mygallery:{ base:baseUrl + '/js/yui-library/', modules:{ 'gallery-outside-events':{ requires:['event-focus', 'event-synthetic'] } ,'gallery-overlay-modal':{} ,'gallery-overlay-extras':{ requires:['overlay','gallery-outside-events','plugin','event-resize'] } } } }; |
|
Hey Marc,
What version of the YUI seed file are you using? Normally, if the gallery module has the requirements well defined, you don't need to do it again, and YUI loader will be smart enough to compute them. That was introduced in 3.1.x if I remember correctly. Best Regards, Caridy |
MarcYUI Contributor
|
Hi Caridy,
I'm using 3.1.1. The problem I think was that with YUI.add there is no option to define a gallery, like with YUI().use. I was trying to work around that but the groups approach is much better and works fine for me. All my stuff migrated to YUI 3 now, just calendar and simple editor left. Me happy Kind regards, Marc |
| Page 1 of 2 | [ 12 posts ] | Go to page 1, 2 Next |
| 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 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group