Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
(function() {
var SomeUI;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
SomeUI = (function() {
function SomeUI($el) {
this.$el = $el;
this.$content = $el.find('.content');
this.$button1 = $el.find('.button1');
this.$button2 = $el.find('.button2');
this._eventify();
}
SomeUI.prototype._eventify = function() {
this.$button1.click(__bind(function() {
return this.instantToggle();
}, this));
this.$button2.click(__bind(function() {
return this.delayedToggle();
}, this));
return this;
};
SomeUI.prototype.instantToggle = function() {
this.$content.fadeToggle();
return this;
};
SomeUI.prototype.delayedToggle = function() {
setTimeout((__bind(function() {
return this.$content.fadeToggle();
}, this)), 1000);
return this;
};
return SomeUI;
})();
$.fn.someUI = function() {
return this.each(function() {
return new SomeUI($(this));
});
};
$(function() {
return $('.someUI').someUI();
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.