diff interfaces/AB.js @ 2794:b4e91500891a

#133 Added individual images to AB
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Sun, 23 Apr 2017 11:10:38 +0100
parents cae61c5bbed1
children 64a5603831e2
line wrap: on
line diff
--- a/interfaces/AB.js	Sun Apr 23 10:39:02 2017 +0100
+++ b/interfaces/AB.js	Sun Apr 23 11:10:38 2017 +0100
@@ -213,6 +213,13 @@
         this.box.id = 'comparator-' + text;
         this.selector = document.createElement('div');
         this.selector.className = 'comparator-selector disabled';
+        if (audioElement.specification.image) {
+            this.selector.className += " comparator-image";
+            var image = document.createElement("img");
+            image.src = audioElement.specification.image;
+            image.className = "comparator-image";
+            this.selector.appendChild(image);
+        }
         var selectorText = document.createElement('span');
         selectorText.textContent = text;
         this.selector.appendChild(selectorText);
@@ -263,7 +270,7 @@
             } else if (event.currentTarget === this.playback) {
                 this.playbackClicked();
             }
-        }
+        };
         this.playback.addEventListener("click", this);
         this.selector.addEventListener("click", this);