equal
deleted
inserted
replaced
14 this.set('autoscroll', true); |
14 this.set('autoscroll', true); |
15 }), |
15 }), |
16 |
16 |
17 didUpdate: function() { |
17 didUpdate: function() { |
18 var self = this; |
18 var self = this; |
19 if(this.get('autoscroll')) { |
19 var target = Ember.$('.sentence.active'); |
|
20 if(this.get('autoscroll') && target.length) { |
20 Ember.$(this.get('autoscrollElement')).animate({ |
21 Ember.$(this.get('autoscrollElement')).animate({ |
21 scrollTop: Ember.$('.sentence.active').offset().top + Ember.$(this.get('autoscrollElement')).scrollTop() - Ember.$(this.get('autoscrollElement')).offset().top - 154 |
22 scrollTop: target.offset().top + Ember.$(this.get('autoscrollElement')).scrollTop() - Ember.$(this.get('autoscrollElement')).offset().top - 154 |
22 }, 150); |
23 }, 150); |
23 } |
24 } |
24 }, |
25 }, |
25 |
26 |
26 actions: { |
27 actions: { |