Skip to content

Instantly share code, notes, and snippets.

@jarrettmeyer
Created December 20, 2013 13:28
Show Gist options
  • Save jarrettmeyer/8054716 to your computer and use it in GitHub Desktop.
Save jarrettmeyer/8054716 to your computer and use it in GitHub Desktop.
(function () {
var defaults = {
message: "Waiting...",
selector: ".text-selector"
}
window.thing = {
initialize: function (opts) {
this.options = $.extend(defaults, opts);
this.$el = $(this.options.selector);
return this;
},
show: function (opts) {
var message = (opts && opts.message) || this.options.message;
this.$el.text(message);
// snip...
return this;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment