cms/app-client/app/components/transcript-turn-component.js
author ymh <ymh.work@gmail.com>
Fri, 02 Dec 2016 03:30:51 +0100
changeset 455 a8bed1c7df8e
parent 454 710a2ae08a74
child 457 a7a333c0b1eb
permissions -rw-r--r--
move the transcript highlight and autoscroll logic to the base component
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
454
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import Ember from 'ember';
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
export default Ember.Component.extend({
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
  tagName: 'li',
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
  classNames: ['sentence'],
455
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
     7
  // classNameBindings: ['isPlaying:active'],
454
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
  begin: Ember.computed.readOnly('turn.begin'),
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
  end: Ember.computed.readOnly('turn.end'),
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
  title: Ember.computed.readOnly('turn.title'),
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
  annotations: Ember.computed.readOnly('turn.annotations'),
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
455
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    14
  // isPlaying: Ember.computed("player.progress", "begin", "end", function() {
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    15
  //   var progress = this.get('player.progress');
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    16
  //   return progress && progress >= this.get('begin') && progress < this.get('end');
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    17
  // }),
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    18
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    19
  didInsertElement: function() {
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    20
    if(this.get('intervals')) {
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    21
      this.get('intervals').add(this.get('begin'), this.get('end'), this.get('elementId'), this.$());
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    22
    }
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    23
  },
a8bed1c7df8e move the transcript highlight and autoscroll logic to the base component
ymh <ymh.work@gmail.com>
parents: 454
diff changeset
    24
454
710a2ae08a74 rework transcript component to correct various bugs
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
});