Mercurial > hg > webaudioevaluationtool
diff interfaces/ABX.js @ 2806:ee3059744a6e
Add fixed images to ABX with an example
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Tue, 25 Apr 2017 10:30:52 +0100 |
parents | cae61c5bbed1 |
children | 64a5603831e2 |
line wrap: on
line diff
--- a/interfaces/ABX.js Tue Apr 25 09:52:44 2017 +0100 +++ b/interfaces/ABX.js Tue Apr 25 10:30:52 2017 +0100 @@ -208,6 +208,15 @@ this.playback.className = 'comparator-button'; this.playback.disabled = true; this.playback.textContent = "Listen"; + if (element.specification.image) { + this.selector.className += " comparator-image"; + var image = document.createElement("img"); + image.src = element.specification.image; + image.className = "comparator-image"; + this.selector.appendChild(image); + } else if (label === "X") { + this.selector.classList.add('inactive'); + } this.box.appendChild(this.selector); this.box.appendChild(this.playback); this.selectorClicked = function (event) { @@ -391,7 +400,6 @@ var label; var audioObject = audioEngineContext.newTrack(element); node = buildElement.call(this, 3, audioObject); - node.box.children[0].classList.add('inactive'); audioObject.bindInterface(node); this.X = node; this.boxHolders.appendChild(node.box);