@@ -320,7 +320,7 @@ function getJSON(url, callback, ...args) {
320320 jsonRequest . send ( null ) ;
321321}
322322
323- function renderSingleBadge ( key , envLabel , envLink , branchLink , badge_url ) {
323+ function renderSingleBadge ( key , field , envLabel , envLink , branchLink , badge_url ) {
324324 var json_obj = JSON . parse ( this . responseText )
325325 var branchLabel = json_obj . message
326326 var color = json_obj . color
@@ -341,11 +341,11 @@ function renderSingleBadge (key, envLabel, envLink, branchLink, badge_url) {
341341 badgeText += '<span class="ci-label-branch-' + color + '">' + branchLabel + '</span>'
342342 }
343343 badgeText += '</span>'
344- document . getElementById ( key ) . outerHTML = badgeText
344+ document . getElementById ( key + '-' + field ) . outerHTML = badgeText
345345}
346346
347- function renderBadgePlaceholder ( key ) {
348- return '<span id="' + key + '"><svg class="pf-c-spinner pf-m-md" role="progressbar" viewBox="0 0 100 100" aria-label="Loading..."><circle class="pf-c-spinner__path" cx="50" cy="50" r="45" fill="none" /></svg></span>'
347+ function renderBadgePlaceholder ( key , field ) {
348+ return '<span id="' + key + '-' + field + ' "><svg class="pf-c-spinner pf-m-md" role="progressbar" viewBox="0 0 100 100" aria-label="Loading..."><circle class="pf-c-spinner__path" cx="50" cy="50" r="45" fill="none" /></svg></span>'
349349}
350350
351351function renderBadges ( badges , field , value , links ) {
@@ -363,8 +363,9 @@ function renderBadges (badges, field, value, links) {
363363 envLink = encodeURI ( b . getURI ( ) )
364364 branchLink = encodeURI ( repo_url ( b . pattern ) ) ;
365365 }
366- badgeText += renderBadgePlaceholder ( b . string ( ) )
367- getJSON ( b . getURI ( ) , renderSingleBadge , b . string ( ) , b . getLabel ( field ) , envLink , branchLink , b . getURI ( ) )
366+ console . log ( field )
367+ badgeText += renderBadgePlaceholder ( b . string ( ) , field )
368+ getJSON ( b . getURI ( ) , renderSingleBadge , b . string ( ) , field , b . getLabel ( field ) , envLink , branchLink , b . getURI ( ) )
368369 } )
369370 badgeText += '</div>'
370371 return badgeText
0 commit comments