Skip to content

Instantly share code, notes, and snippets.

@jechlin
Created September 19, 2016 11:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jechlin/27993535f4e27ff5e3886dcf68268e3d to your computer and use it in GitHub Desktop.
Save jechlin/27993535f4e27ff5e3886dcf68268e3d to your computer and use it in GitHub Desktop.
(function ($) {
$(function () {
AJS.dialog2.on("show", function (e) {
var targetId = e.target.id;
if (targetId == "my-own-dialog") {
var someDialog = AJS.dialog2(e.target);
$(e.target).find("#dialog-close-button").click(function (e) {
e.preventDefault();
someDialog.hide();
someDialog.remove();
});
$(e.target).find("#button-A").click(function (e) {
$.ajax({
type: "GET",
dataType: "json",
"contentType": "application/json",
url: AJS.params.baseURL + "/rest/scriptrunner-jira/latest/custom/...",
done: function (data) {
// do something with data
},
fail: function(data) {
alert("Error: ...");
},
always: function() {
//
}
})
});
}
});
});
})(AJS.$);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment