Skip to content

Commit

Permalink
fix(jira): refactor get baseUrl method
Browse files Browse the repository at this point in the history
  • Loading branch information
qoomon committed Oct 15, 2017
1 parent fe03dba commit 434f4c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jira-issue-card-printer",
"version": "5.2.10",
"version": "5.2.11",
"description": "Beautiful Issue Card Printer",
"author": "Bengt Brodersen",
"license": "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)",
Expand Down
12 changes: 7 additions & 5 deletions source-files/lib/jira-issue-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ var $ = require('jquery');
var name = "JIRA";

var baseUrl = function () {
try {
return $("input[title='baseURL']").attr('value');
} catch (ex) {
return window.location.origin;
}
var result = window.location.origin;
if (AJS && AJS.params && AJS.params.baseURL){
result = AJS.params.baseURL;
} else if ($("input[title='baseURL']") && $("input[title='baseURL']").val()){
result = $("input[title='baseURL']").val();
}
return result;
};

var isEligible = function () {
Expand Down
2 changes: 1 addition & 1 deletion source-files/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ var main = function(issueTrackers) {
// render cards
promises.push(renderCards(issueKeyList));

$("#card-print-dialog-title", global.appFrame.document).text("Card Printer " + global.version + " - Loading issues...");
$("#card-print-dialog-title", global.appFrame.document).html("Card Printer " + global.version + " - <b>Loading...</b>");
return Promise.all(promises).then(function () {
$("#card-print-dialog-title", global.appFrame.document).text("Card Printer " + global.version);
});
Expand Down

0 comments on commit 434f4c5

Please sign in to comment.