diff --git a/CHANGELOG.md b/CHANGELOG.md index b1c6dda..a2fe294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Changelog of Pull Request Notifier for Bitbucket. ### No issue Latest changelog plugin - [a2ae249fec5b6f1](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/a2ae249fec5b6f1) Tomas Bjerre *2016-06-24 09:38:01* + [daf75d6290a7d25](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/daf75d6290a7d25) Tomas Bjerre *2016-06-24 21:25:53* ## 2.26 ### GitHub [#124](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/124) PR Updated not triggering a Job diff --git a/src/main/resources/admin.js b/src/main/resources/admin.js index 043ec6b..cf03c8a 100644 --- a/src/main/resources/admin.js +++ b/src/main/resources/admin.js @@ -11,7 +11,7 @@ define('plugin/prnfb/admin', [ var buttonsAdminUrlPostUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings/buttons";  var buttonsAdminUrl = buttonsAdminUrlPostUrl; - +console.log("asd"); if ($('#prnfbRepositorySlug').length !== 0) { var projectKey = $('#prnfbProjectKey').val(); var repositorySlug = $('#prnfbRepositorySlug').val(); diff --git a/src/main/resources/pr-triggerbutton.js b/src/main/resources/pr-triggerbutton.js index 089a690..407f0bf 100644 --- a/src/main/resources/pr-triggerbutton.js +++ b/src/main/resources/pr-triggerbutton.js @@ -8,32 +8,17 @@ define('plugin/prnfb/pr-triggerbutton', [ var waiting = 'Wait'; - var $buttonArea = $(".triggerManualNotification").parent(); - var $buttonTemplate = $(".triggerManualNotification"); - $buttonTemplate.empty().remove(); - - $buttonDropdownArea = $('
'); - $buttonDropdownItems = $buttonDropdownArea.find("ul"); - - var $buttonDropdownParent = $buttonTemplate.clone(); - $buttonDropdownParent.html("Actions"); - $buttonDropdownParent.attr("aria-owns", "triggerManualNotification-actions"); - $buttonDropdownParent.attr("aria-haspopup", "true"); - $buttonDropdownParent.addClass("aui-style-default aui-dropdown2-trigger"); - $buttonArea.append($buttonDropdownParent); - $buttonDropdownParent.hide(); - - $("body").append($buttonDropdownArea); + var $buttonArea = $(".triggerManualNotification").closest('ul'); + $(".triggerManualNotification").remove(); function loadSettingsAndShowButtons() { var hasButtons = false; - $buttonDropdownItems.empty(); $.get(buttonsAdminUrl + '/repository/' + pageState.getRepository().id + '/pullrequest/' + pageState.getPullRequest().id, function(settings) { settings.forEach(function(item) { hasButtons = true; - var $buttonDropdownItem = $('
  • ' + item.name + '
  • '); - $buttonDropdownItem.find("a").click(function() { + var $buttonDropdownItem = $('
  • '); + $buttonDropdownItem.find("button").click(function() { var $this = $(this); $this.attr("disabled", "disabled"); $this.attr("aria-disabled", "true"); @@ -48,7 +33,7 @@ define('plugin/prnfb/pr-triggerbutton', [ }); }); - $buttonDropdownItems.append($buttonDropdownItem); + $buttonArea.append($buttonDropdownItem); }); if (hasButtons) {