Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit f88dcfe

Browse files
committed
Making buttons compatible with 4.7.1 #128
1 parent daf75d6 commit f88dcfe

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Changelog of Pull Request Notifier for Bitbucket.
66
### No issue
77
Latest changelog plugin
88

9-
[a2ae249fec5b6f1](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/a2ae249fec5b6f1) Tomas Bjerre *2016-06-24 09:38:01*
9+
[daf75d6290a7d25](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/daf75d6290a7d25) Tomas Bjerre *2016-06-24 21:25:53*
1010

1111
## 2.26
1212
### GitHub [#124](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/issues/124) PR Updated not triggering a Job

src/main/resources/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ define('plugin/prnfb/admin', [
1111

1212
var buttonsAdminUrlPostUrl = AJS.contextPath() + "/rest/prnfb-admin/1.0/settings/buttons"; 
1313
var buttonsAdminUrl = buttonsAdminUrlPostUrl;
14-
14+
console.log("asd");
1515
if ($('#prnfbRepositorySlug').length !== 0) {
1616
var projectKey = $('#prnfbProjectKey').val();
1717
var repositorySlug = $('#prnfbRepositorySlug').val();

src/main/resources/pr-triggerbutton.js

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,17 @@ define('plugin/prnfb/pr-triggerbutton', [
88

99
var waiting = '<span class="aui-icon aui-icon-wait aui-icon-small">Wait</span>';
1010

11-
var $buttonArea = $(".triggerManualNotification").parent();
12-
var $buttonTemplate = $(".triggerManualNotification");
13-
$buttonTemplate.empty().remove();
14-
15-
$buttonDropdownArea = $('<div id="triggerManualNotification-actions" class="aui-style-default aui-dropdown2"><ul class="aui-list-truncate"></ul></div>');
16-
$buttonDropdownItems = $buttonDropdownArea.find("ul");
17-
18-
var $buttonDropdownParent = $buttonTemplate.clone();
19-
$buttonDropdownParent.html("Actions");
20-
$buttonDropdownParent.attr("aria-owns", "triggerManualNotification-actions");
21-
$buttonDropdownParent.attr("aria-haspopup", "true");
22-
$buttonDropdownParent.addClass("aui-style-default aui-dropdown2-trigger");
23-
$buttonArea.append($buttonDropdownParent);
24-
$buttonDropdownParent.hide();
25-
26-
$("body").append($buttonDropdownArea);
11+
var $buttonArea = $(".triggerManualNotification").closest('ul');
12+
$(".triggerManualNotification").remove();
2713

2814
function loadSettingsAndShowButtons() {
2915
var hasButtons = false;
30-
$buttonDropdownItems.empty();
3116
$.get(buttonsAdminUrl + '/repository/' + pageState.getRepository().id + '/pullrequest/' + pageState.getPullRequest().id, function(settings) {
3217
settings.forEach(function(item) {
3318
hasButtons = true;
3419

35-
var $buttonDropdownItem = $('<li><a class="aui-icon-container" href="#">' + item.name + '</a></li>');
36-
$buttonDropdownItem.find("a").click(function() {
20+
var $buttonDropdownItem = $('<li><button class="aui-button aui-button-link" role="menuitem">' + item.name + '</button></li>');
21+
$buttonDropdownItem.find("button").click(function() {
3722
var $this = $(this);
3823
$this.attr("disabled", "disabled");
3924
$this.attr("aria-disabled", "true");
@@ -48,7 +33,7 @@ define('plugin/prnfb/pr-triggerbutton', [
4833
});
4934
});
5035

51-
$buttonDropdownItems.append($buttonDropdownItem);
36+
$buttonArea.append($buttonDropdownItem);
5237
});
5338

5439
if (hasButtons) {

0 commit comments

Comments
 (0)