Skip to content

Instantly share code, notes, and snippets.

@rainhead
Created June 10, 2009 00:32
Show Gist options
  • Save rainhead/126929 to your computer and use it in GitHub Desktop.
Save rainhead/126929 to your computer and use it in GitHub Desktop.
// From http://developer.yahoo.com/yui/3/examples/overlay/overlay-io-plugin.html
YUI3.use('overlay', 'io', function(Y) {
function Lightbox(config) {
arguments.callee.superclass.constructor.call(this, config);
};
Lightbox.NAME = "lightbox";
Lightbox.NS = "lightbox";
Y.extend(Lightbox, Y.Overlay, {
syncUI: function() {
var cfg = {on: {}};
cfg.on.success = Y.bind(this._ioSuccess, this);
cfg.method = "GET";
console.log("Making request!");
Y.io(this.get("uri"), cfg);
},
_ioSuccess: function(id, o) {
console.log("Got content!");
this.set('bodyContent', o.responseText);
}
});
window.Lightbox = Lightbox;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment