Skip to content

Commit

Permalink
Merge pull request #37 from JulioGold/issue_hash
Browse files Browse the repository at this point in the history
Issue hash
Thanks @JulioGold :)
  • Loading branch information
felipenmoura authored Apr 6, 2019
2 parents 09fe84c + cfaa2f1 commit 7a78067
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@

(function () {
let url = Github.urls.inCampaign
let issueNumber;

if(window.location.hash) {
issueNumber = window.location.hash.substring(1).match(/\d+/)[0];
}

let url = Github.urls.inCampaign;

if (issueNumber) {
UI.currentIssue = issueNumber;
}

if (UI.currentIssue) {
url = Github.parseURL(Github.urls.issue, { issue: (UI.currentIssue.number || UI.currentIssue) })
url = Github.parseURL(Github.urls.issue, { issue: (UI.currentIssue.number || UI.currentIssue) });
}

getJSON(url)
.then(result => {
if (Array.isArray(result)) {
Expand All @@ -17,6 +29,4 @@
new Weekly(result)
}
})

})()

0 comments on commit 7a78067

Please sign in to comment.