Skip to content

Instantly share code, notes, and snippets.

@apipkin
Forked from joeauty/gist:743088
Created December 16, 2010 19:44
Show Gist options
  • Save apipkin/743882 to your computer and use it in GitHub Desktop.
Save apipkin/743882 to your computer and use it in GitHub Desktop.
YUI.add('photogallery', function(Y){
Y.Photogallery = Y.Base.create('photogallery', Y.Widget, [], {
initCollectionObservers : function() {
// var gotoCollectionCallback = this.gotoCollection;
// var galleryAttributes = this.galleryAttributes;
Y.all('#collectionsul .collectionli .buttonWrapper').each(function(o) {
this.set('cid', o.get('id').replace(/^collection_/,''));
webkit.setupButton(o.get('id'), Y.bind(function(){ this.gotoCollection(this.getAttrs()); }, this), this);
// webkit.setupButton(o.get('id'), this.gotoCollection, this);
},this);
},
gotoCollection : function(attrs) {
switch (attrs.get('cid')) {
case 'showall':
break;
default:
break;
}
Y.log('go to collection');
}
}, {
ATTRS : {
cid : undefined
}
});
}, '0.1', {requires: ['base-build', 'node', 'widget', 'io-base', 'transition', 'attribute']});
YUI().use('photogallery', function(Y) {
var photogallery = new Y.Photogallery();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment