Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CreateWorkSubTask(key) {
- console.log(key);
- var span = jQuery("#create_work_sub_task_link span");
- if (span.length) {
- console.log("make wait");
- var oldLabel = span.text();
- var sp_width = span.css("width");
- console.log(sp_width);
- span.css("display", "block");
- span.css("width", sp_width);
- span.text("waiting...");
- var dots = window.setInterval( function() {
- if (span.text().length > 9) {
- span.text(span.text().substring(0,7));
- } else {
- span.text(span.text() + ".");
- }
- }, 100)
- }
- var p = jQuery.post(
- "/plugins/servlet/createWorkSubTask",
- {"issueKey": key},
- function(data) {
- console.log(data);
- if (data.uri) {
- window.location.replace(data.uri);
- } else {
- alert(data.message);
- window.clearInterval(dots);
- span.text(oldLabel);
- }
- },
- "json"
- );
- p.fail(function() {
- console.log("fail");
- alert("can't create work sub-task, please contact with jira administrators");
- window.clearInterval(dots);
- span.text(oldLabel);
- });
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement