Skip to content

Commit

Permalink
Fix: sources display
Browse files Browse the repository at this point in the history
  • Loading branch information
Asenar committed Apr 10, 2017
1 parent 4f3adcb commit 76714ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ footer {
display : block;
font-weight: normal;
margin : 2px;
padding : 2px 8px;
}


Expand Down
11 changes: 7 additions & 4 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,18 @@ function main() {
//document.querySelector("#conflicts span.content").innerText = background.conflits;
//document.querySelector("#subsidies span.content").innerText = background.subventions;

var par = document.querySelector("#sources .content"); par.innerText = "";
var source_wrapper = document.querySelector("#sources");
var target_sources = document.querySelector("#sources .content");
target_sources.innerText = "";

if (background.sources.length == 0) {
var par = document.querySelector("#sources").style.display = "none";
source_wrapper.style.display = "none";
}
else {
var par = document.querySelector("#sources").style.display = "block";
source_wrapper.style.display = "block";
for(var i in background.sources) {
var obj = background.sources[i];
createLink(par,obj.url,obj.title);
createLink(target_sources, obj.url, obj.title);
}
}

Expand Down

0 comments on commit 76714ca

Please sign in to comment.