-
-
Save infernalsirius/13b2044670086f192d087a5c1d955028 to your computer and use it in GitHub Desktop.
[Dialog and REST endpoint]#atlassian
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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