From 8ac1501ad7f8b350bd9c1bf01b25f994fd3560f9 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Fri, 5 Jan 2018 20:56:50 +0200 Subject: Add Pull Request merge options - Ignore white-space for conflict checking, Rebase, Squash merge (#3188) * Pull request options migration and UI in settings * Add ignore whitespace functionality * Fix settings if pull requests are disabled * Fix migration transaction * Merge with Rebase functionality * UI changes and related functionality for pull request merging button * Implement squash functionality * Fix rebase merging * Fix pull request merge tests * Add squash and rebase tests * Fix API method to reuse default message functions * Some refactoring and small fixes * Remove more hardcoded values from tests * Remove unneeded check from API method * Fix variable name and comment typo * Fix reset commit count after PR merge --- public/js/index.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'public') diff --git a/public/js/index.js b/public/js/index.js index 9104bf6400..160be5b684 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -649,6 +649,28 @@ function initRepository() { $('#status').val($statusButton.data('status-val')); $('#comment-form').submit(); }); + + // Pull Request merge button + var $mergeButton = $('.merge-button > button'); + $mergeButton.on('click', function(e) { + e.preventDefault(); + $('.' + $(this).data('do') + '-fields').show(); + $(this).parent().hide(); + }); + $('.merge-button > .dropdown').dropdown({ + onChange: function (text, value, $choice) { + if ($choice.data('do')) { + $mergeButton.find('.button-text').text($choice.text()); + $mergeButton.data('do', $choice.data('do')); + } + } + }); + $('.merge-cancel').on('click', function(e) { + e.preventDefault(); + $(this).closest('.form').hide(); + $mergeButton.parent().show(); + }); + initReactionSelector(); } -- cgit v1.2.3