From 93a25bac98a91eac3a9800ab368f082339525cdf Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Tue, 12 May 2015 13:34:26 +0200 Subject: [PATCH] fix single story view for pivotal tracker --- bookmarklet.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bookmarklet.js b/bookmarklet.js index d8bea47..df3fad3 100644 --- a/bookmarklet.js +++ b/bookmarklet.js @@ -159,8 +159,7 @@ console.logInfo("load " + issueKeyList.length + " issues..."); var deferredList = []; - - issueKeyList.each(function(index, issueKey) { + jQuery.each(issueKeyList,function(index, issueKey) { var page = newPage(issueKey); page.attr("index",index); page.hide(); @@ -225,16 +224,15 @@ } function getSelectedIssueKeyListPivotalTracker() { - //Single Story - if (/.*\/n\/projects\/.*\/stories\/.*/g.test(document.URL)) { - return jQuery('.story[data-id]').map(function() { - return jQuery(this).attr('data-id'); - }); + if (/.*\/stories\/.*/g.test(document.URL)) { + + + return [document.URL.replace(/.*\/stories\/(.*)\??/,'$1')]; } // Board - if (/.*\/n\/projects\/.*/g.test(document.URL)) { + if (/.*\/projects\/.*/g.test(document.URL)) { return jQuery('.story[data-id]:has(.selected)').map(function() { return jQuery(this).attr('data-id'); });