Mercurial > hg > webaudioevaluationtool
changeset 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 | 1076ac62823f |
children | b4735c529a8e |
files | interfaces/AB.css interfaces/AB.js |
diffstat | 2 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/interfaces/AB.css Sun Apr 23 10:39:02 2017 +0100 +++ b/interfaces/AB.css Sun Apr 23 11:10:38 2017 +0100 @@ -64,6 +64,17 @@ display: block; margin: auto; } +div.comparator-image { + background-color: rgba(255,255,255,0); +} +img.comparator-image { + width: inherit; + height: inherit; + z-index: -1; + position: absolute; + display: inline; + right: 0px; +} div.disabled { background-color: #AAA; }
--- 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);