Skip to content

Commit

Permalink
Added issue selection by hash. braziljs#6
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioGold committed Oct 15, 2018
1 parent 07ec09e commit cfaa2f1
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 cfaa2f1

Please sign in to comment.