From 76714ca32527ba93c8a0f5ca1450a335316ad4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Marinetti?= Date: Mon, 10 Apr 2017 14:48:55 +0200 Subject: [PATCH] Fix: sources display --- css/main.css | 1 + popup.js | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/css/main.css b/css/main.css index 4508b11..c8b7e64 100644 --- a/css/main.css +++ b/css/main.css @@ -235,6 +235,7 @@ footer { display : block; font-weight: normal; margin : 2px; + padding : 2px 8px; } diff --git a/popup.js b/popup.js index 4357bae..835eb18 100644 --- a/popup.js +++ b/popup.js @@ -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); } }