Skip to content

Instantly share code, notes, and snippets.

@eegeeZA
Last active February 1, 2023 08:16
Show Gist options
  • Save eegeeZA/bb0900a8d694341d874f2f702dc421e2 to your computer and use it in GitHub Desktop.
Save eegeeZA/bb0900a8d694341d874f2f702dc421e2 to your computer and use it in GitHub Desktop.
Add a button to minimize the contents of a file in Bitbucket pull requests
(() => {
const fileHeading = $(".diff-container .heading").find(".aui-buttons:first");
const minimizeButton = $("<button>").addClass('aui-button').text('Minimize');
minimizeButton.click(function (element) {
const fileContents = $(element.target).closest('div.diff-container').find(".diff-content-container");
fileContents.toggle();
});
fileHeading.append(minimizeButton);
})();
// Bookmarklet => javascript:(function(){var b=$(".diff-container .heading").find(".aui-buttons:first"),a=$("<button>").addClass("aui-button").text("Minimize");a.click(function(a){$(a.target).closest("div.diff-container").find(".diff-content-container").toggle()});b.append(a)})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment