# HG changeset patch # User Nicholas Jillings # Date 1450367896 0 # Node ID 7ea59d3594e0942c9bdfeeb4121d8c2b1e82bdef # Parent 6e01da7f9f922a310327535eecc40d12a41aa471 MUSHRA: resizeWindow(event) function introduced. diff -r 6e01da7f9f92 -r 7ea59d3594e0 mushra.js --- a/mushra.js Thu Dec 17 13:34:23 2015 +0000 +++ b/mushra.js Thu Dec 17 15:58:16 2015 +0000 @@ -218,12 +218,35 @@ return this.slider.value; }; + this.resize = function(event) + { + this.holder.style.height = window.innerHeight-200 + 'px'; + this.slider.style.height = window.innerHeight-250 + 'px'; + } + if (this.parent.state == 1) { this.enable(); } } +function resizeWindow(event) +{ + // Function called when the window has been resized. + // MANDATORY FUNCTION + + // Auto-align + var numObj = audioEngineContext.audioObjects.length; + var totalWidth = (numObj-1)*150+100; + var diff = (window.innerWidth - totalWidth)/2; + document.getElementById('slider').style.height = window.innerHeight - 180 + 'px'; + audioEngineContext.audioObjects[0].interfaceDOM.holder.style.marginLeft = diff + 'px'; + for (var i in audioEngineContext.audioObjects) + { + audioEngineContext.audioObjects[i].interfaceDOM.resize(event); + } +} + function buttonSubmitClick() // TODO: Only when all songs have been played! {