From c8f1415b6d1c45bd73d8a14325a1bd9a1c0fd289 Mon Sep 17 00:00:00 2001 From: Harsh Vakharia Date: Thu, 13 Oct 2016 20:50:41 +0530 Subject: [PATCH] Check stat bar before inserting li node. Fixes #12 --- src/inject.js | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/src/inject.js b/src/inject.js index 5362e5d..37ae9f3 100755 --- a/src/inject.js +++ b/src/inject.js @@ -1,6 +1,7 @@ /* global fetch, Request, Headers */ const API = 'https://api.github.com/repos/' +const LI_TAG_ID = 'github-repo-size' function isTree (uri) { var repoURI = uri.split('/') @@ -50,7 +51,7 @@ function getHumanReadableSize (size) { function getSizeHTML (size) { const humanReadableSize = getHumanReadableSizeObject(size) - return '
  • ' + + return '
  • ' + '' + '' + getHumanReadableSize(t) + '' + var td = document.createElement('td') + td.className = 'age' + td.innerHTML = '' + getHumanReadableSize(t) + '' - o.parentNode.parentNode.parentNode.insertBefore(td, ageForReference[i++]) - } - }) + o.parentNode.parentNode.parentNode.insertBefore(td, ageForReference[i++]) + } + }) + } } }