Mercurial > hg > webaudioevaluationtool
changeset 1144:5d29ff213161
popup resize not called if not created. Horizontal sliders resize on window resize function.
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Wed, 13 Jan 2016 14:02:00 +0000 |
parents | c1c5cb020fd3 |
children | 96a9c9703849 |
files | core.js interfaces/horizontal-sliders.js |
diffstat | 2 files changed, 18 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/core.js Wed Jan 13 12:27:38 2016 +0000 +++ b/core.js Wed Jan 13 14:02:00 2016 +0000 @@ -664,11 +664,13 @@ this.resize = function(event) { // Called on window resize; - this.popup.style.left = (window.innerWidth/2)-250 + 'px'; - this.popup.style.top = (window.innerHeight/2)-125 + 'px'; - var blank = document.getElementsByClassName('testHalt')[0]; - blank.style.width = window.innerWidth; - blank.style.height = window.innerHeight; + if (this.popup != null) { + this.popup.style.left = (window.innerWidth/2)-250 + 'px'; + this.popup.style.top = (window.innerHeight/2)-125 + 'px'; + var blank = document.getElementsByClassName('testHalt')[0]; + blank.style.width = window.innerWidth; + blank.style.height = window.innerHeight; + } }; }
--- a/interfaces/horizontal-sliders.js Wed Jan 13 12:27:38 2016 +0000 +++ b/interfaces/horizontal-sliders.js Wed Jan 13 14:02:00 2016 +0000 @@ -234,6 +234,11 @@ $(outsideReference).removeClass('track-slider-playing'); } }; + this.resize = function(event) + { + this.holder.style.width = window.innerWidth-200 + 'px'; + this.slider.style.width = window.innerWidth-420 + 'px'; + }; this.enable = function() { // This is used to tell the interface object that playback of this node is ready @@ -280,6 +285,12 @@ var canvas = document.getElementById('scale-canvas'); canvas.width = window.innerWidth-420; canvas.height = totalHeight; + for (var i in audioEngineContext.audioObjects) + { + if (audioEngineContext.audioObjects[i].specification.type != 'outside-reference'){ + audioEngineContext.audioObjects[i].interfaceDOM.resize(event); + } + } drawScale(); }