Skip to content

Instantly share code, notes, and snippets.

View joeauty's full-sized avatar

Joe Auty joeauty

  • FlipGive, MedStack, Thinkdata Works, nanoPay, Sigstr, DataSprocket, NetMusician
View GitHub Profile
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);
var newimage = new Image();
newimage.src = thumbpic;
Y.one('#photoswrapperproxyinner').append('<div class="photo newimage"><img src = "' + newimage.src + '" /></div>');
var imagewait = setInterval(function() {
if (parseInt(Y.one('#photoswrapperproxyinner .newimage').getComputedStyle('width')) == newimage.width && parseInt(Y.one('#photoswrapperproxyinner .newimage').getComputedStyle('height')) == newimage.height) {
Y.one('#photoswrapperproxyinner .newimage').removeClass('newimage');
clearInterval(imagewait);
var photogallery = new Y.Photogallery();
photogallery.resizeSpace();
}
Y.Photogallery = Y.Base.create('photogallery', Y.Widget, [], {
maxwidth : 500,
initSpace : function() {
this.setInitialSpace();
},
setInitialSpace : function() {
Y.log(Y.Photogallery.maxwidth);
},