Skip to content

Instantly share code, notes, and snippets.

@bricker
Last active December 30, 2015 08:19
Show Gist options
  • Save bricker/7801917 to your computer and use it in GitHub Desktop.
Save bricker/7801917 to your computer and use it in GitHub Desktop.
javascript:(function()%7B%24(%22.file%20.meta%22).each(function()%7Bvar%20btn%3D%24(%22%3Cbutton%20/%3E%22,%7Bclass:%22fileHider%22,text:%22HIDE%22%7D)%3B%24(this).append(btn)%3B%7D)%3B%24(%22.fileHider%22).on(%22click%22,function()%7Bvar%20data%3D%24(this).parents(%22.file%22).find(%22.data,%20.image%22)%3Bdata.toggle()%3B%7D)%3B%7D)()%3B
(function() {
$(".file .meta").each(function() {
var btn = $("<button />", { class: "fileHider", text: "HIDE" });
$(this).append(btn);
})
$(".fileHider").on("click", function() {
var data = $(this).parents(".file").find(".data, .image");
data.toggle();
})
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment