Skip to content

Instantly share code, notes, and snippets.

@divineforest
Created February 17, 2010 10:43
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 divineforest/306501 to your computer and use it in GitHub Desktop.
Save divineforest/306501 to your computer and use it in GitHub Desktop.
function Wish(wish_div) {
this._wish_div = wish_div;
this._header = this._wish_div.find("div.header");
this._content = this._wish_div.find("div.content");
this._showItems = this._wish_div.find(".showItem");
this._tools = this._wish_div.find("div.tools");
}
with(Wish) {
prototype.hide = function() {
this._showItems.each(function() {
$(this).hide()
})
this._tools.hide();
}
prototype.show = function() {
this._showItems.each(function() {
$(this).show()
})
this._tools.show();
}
prototype.update = function(new_content) {
this._header.html(new_content.find("div.header"));
this._content.html(new_content.find("div.content"));
}
}
$("div.wish").each(function() {
wish = new Wish($(this));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment