# HG changeset patch # User Nicholas Jillings # Date 1437641486 -3600 # Node ID f9e50328a26aa1bfcfc7ce3b94b96485fd4427e8 # Parent 317faa29ab11cb47b6bf5f1c9c85630b21c73591 Feature #1327: Elements start out grey until the audioObject states it is ready. Requires all interfaceDOM nodes to have member enable(). diff -r 317faa29ab11 -r f9e50328a26a ape.css --- a/ape.css Thu Jul 23 09:37:27 2015 +0100 +++ b/ape.css Thu Jul 23 09:51:26 2015 +0100 @@ -68,6 +68,10 @@ background-color: rgb(100,200,100); } +div.track-slider-disabled { + background-color: rgb(100,100,100); +} + div.track-slider-playing { background-color: #FF0000; } diff -r 317faa29ab11 -r f9e50328a26a ape.js --- a/ape.js Thu Jul 23 09:37:27 2015 +0100 +++ b/ape.js Thu Jul 23 09:51:26 2015 +0100 @@ -434,14 +434,14 @@ } - testWaitIndicator(); + //testWaitIndicator(); } function sliderObject(audioObject) { // Create a new slider object; this.parent = audioObject; this.trackSliderObj = document.createElement('div'); - this.trackSliderObj.className = 'track-slider'; + this.trackSliderObj.className = 'track-slider track-slider-disabled'; this.trackSliderObj.id = 'track-slider-'+audioObject.id; this.trackSliderObj.setAttribute('trackIndex',audioObject.id); @@ -478,6 +478,13 @@ } }; + this.enable = function() { + if (this.parent.state == 1) + { + $(this.trackSliderObj).removeClass('track-slider-disabled'); + } + }; + this.exportXMLDOM = function(audioObject) { // Called by the audioObject holding this element. Must be present var node = document.createElement('value'); diff -r 317faa29ab11 -r f9e50328a26a core.js --- a/core.js Thu Jul 23 09:37:27 2015 +0100 +++ b/core.js Thu Jul 23 09:51:26 2015 +0100 @@ -909,6 +909,8 @@ audioContext.decodeAudioData(request.response, function(decodedData) { audioObj.buffer = decodedData; audioObj.state = 1; + if (audioObj.specification.type != 'outsidereference') + {audioObj.interfaceDOM.enable();} }, function(){ // Should only be called if there was an error, but sometimes gets called continuously // Check here if the error is genuine