Skip to content

Instantly share code, notes, and snippets.

@joeauty
Created December 16, 2010 05:49
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joeauty/743088 to your computer and use it in GitHub Desktop.
YUI.add('photogallery', function(Y){
Y.Photogallery = Y.Base.create('photogallery', Y.Widget, [], {
initCollectionObservers : function() {
Y.all('#collectionsul .collectionli .buttonWrapper').each(function(o) {
this.set('cid', o.get('id').replace(/^collection_/,''));
var attrs = this.getAttrs();
webkit.setupButton(o.get('id'), Y.bind(this.gotoCollection, this), attrs);
},this);
},
gotoCollection : function(attrs) {
// set cid to current collection
this.set('cid', attrs.cid);
Y.log(this.get('cid'));
/*
switch (attrs.get('cid')) {
case 'showall':
var showalloffset = Y.one('#showall').get('offsetTop') - 2;
break;
default:
// animate #activecollection to default collection
var showalloffset = Y.one('#collection_' + attrs.get('cid')).get('offsetTop') - 2;
break;
}
Y.one('#activecollection').transition({
duration:0.5,
easing:'ease-out',
top:showalloffset + 'px'
});
*/
},
}, {
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