Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created October 23, 2009 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/217097 to your computer and use it in GitHub Desktop.
Save isaacs/217097 to your computer and use it in GitHub Desktop.
/**
* @author apipkin and isaacs
*/
EchoFin = EchoFin || {};
EchoFin.itemsLoading = 0;
EchoFin.GlobalLoaded = false;
YUI().use('node', 'anim', function (Y) {
EchoFin.GlobalLoaded = true;
EchoFin.openLoadScreen = function (e) {
itemsLoading++;
Y.one('#loading_modal_screen').setStyle('display', '');
Y.one('#loading_modal').setStyle('display', '');
};
EchoFin.closeLoadScreen = function (e) {
if(--itemsLoading > 0) {
return;
}
Y.one('#loading_modal_screen').setStyle('display', 'none');
Y.one('#loading_modal').setStyle('display', 'none');
};
EchoFin.moveToRecycleBin = function (binCount) {
var recycleMe = Y.one('#recycle_me');
var recycleBin = Y.one('#footWrapper #recycle_bin');
try {
var recycleIt = new Y.Anim({
node: recycleMe,
to: {
opacity : 0,
opacity: 0,
marginLeft : 0,
width: recycleBin.getComputedStyle('width'),
xy : [(recycleBin.getX()-30),(recycleBin.getY() - 40)]
},
onEnd : function () {
recycleMe.remove();
}
});
recycleIt.run();
// update count on recycle bin
//Y.one('#recycle_bin .count').setContent(binCount);
} catch (ex) {
Y.log(recycleMe);
Y.log(recycleBin);
Y.log(ex);
}
}
EchoFin.itemsLoading++;
Y.on('load',closeLoadScreen, window);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment