# HG changeset patch # User ymh # Date 1480689016 -3600 # Node ID 6a296e92887f50af6125677d8989258e0df12df8 # Parent c3a5f4de29b0c6a3f8d61428a010c39fd9e889e8 add a spinner when opening a transcript diff -r c3a5f4de29b0 -r 6a296e92887f cms/app-client/app/components/playlist-component.js --- a/cms/app-client/app/components/playlist-component.js Fri Dec 02 13:27:02 2016 +0100 +++ b/cms/app-client/app/components/playlist-component.js Fri Dec 02 15:30:16 2016 +0100 @@ -71,7 +71,9 @@ }, displayTranscript: function() { - this.get('player').displayAdditionalInformation('transcript'); + this.get('player').set('transcriptLoading', (this.get('player.window') !== 'transcript')); + + Ember.run.later(() => { this.get('player').displayAdditionalInformation('transcript'); }, 10); }, displayNotice: function() { diff -r c3a5f4de29b0 -r 6a296e92887f cms/app-client/app/components/transcript-component.js --- a/cms/app-client/app/components/transcript-component.js Fri Dec 02 13:27:02 2016 +0100 +++ b/cms/app-client/app/components/transcript-component.js Fri Dec 02 15:30:16 2016 +0100 @@ -45,6 +45,7 @@ }); } this.set('intervals', intervals); + this.get('player').set('transcriptLoading', false); }, onScroll() { diff -r c3a5f4de29b0 -r 6a296e92887f cms/app-client/app/services/player.js --- a/cms/app-client/app/services/player.js Fri Dec 02 13:27:02 2016 +0100 +++ b/cms/app-client/app/services/player.js Fri Dec 02 15:30:16 2016 +0100 @@ -6,6 +6,7 @@ item: null, model: null, transcript: null, + transcriptLoading: false, window: false, playing: false, @@ -31,8 +32,12 @@ displayMetadata: function(el) { if(typeof el !== 'undefined') { this.set('window', el); + if(el==='transcript') { + this.set('transcriptLoading', true); + } } else { this.set('window', false); + this.set('transcriptLoading', false); } }, diff -r c3a5f4de29b0 -r 6a296e92887f cms/app-client/app/templates/components/playlist-component.hbs --- a/cms/app-client/app/templates/components/playlist-component.hbs Fri Dec 02 13:27:02 2016 +0100 +++ b/cms/app-client/app/templates/components/playlist-component.hbs Fri Dec 02 15:30:16 2016 +0100 @@ -12,7 +12,11 @@
{{#if document.transcript_url}} + {{#if (ifAnd (eq player.item document.id) player.transcriptLoading) }} + + {{else}} Transcript + {{/if}} {{/if}} {{#if (ifAnd (eq player.playing true) (eq player.item document.id))}} Pause