Skip to content

Commit 7aa703e

Browse files
authored
Merge pull request #379 from basil/remove-prototype
Replace Prototype.js with native JavaScript
2 parents a73e7f6 + 00b9017 commit 7aa703e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

github-pullrequest-plugin/src/main/webapp/scripts/featureButton.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
function callFeature(button, answerPlaceId, parameters) {
2-
new Ajax.Request(button.action, {
2+
fetch(button.action, {
33
method: "post",
4-
parameters: parameters,
5-
onComplete: function (rsp) {
6-
answerPlaceId.innerHTML = rsp.responseText;
7-
}
4+
headers: crumb.wrap({}),
5+
body: new URLSearchParams(parameters),
6+
}).then(rsp => {
7+
rsp.text().then((responseText) => {
8+
answerPlaceId.innerHTML = responseText;
9+
});
810
});
911
return false;
1012
}

0 commit comments

Comments
 (0)