equal
deleted
inserted
replaced
17 })); |
17 })); |
18 if(this.get('player').get('items').length && this.get('player').get('playing') === false) { |
18 if(this.get('player').get('items').length && this.get('player').get('playing') === false) { |
19 this.get('player').set('item', this.get('player').get('items')[0]); |
19 this.get('player').set('item', this.get('player').get('items')[0]); |
20 } |
20 } |
21 }).on('init'), |
21 }).on('init'), |
|
22 |
|
23 playerItemObserver: Ember.observer('player.item', function() { |
|
24 if(this.$() && this.get('player').get('item')) { |
|
25 var ul = this.$().find('ul'); |
|
26 var li = this.$().find('li#' + this.get('player').get('item').replace('.', '\\.').replace('/', '\\/')); |
|
27 if(li.offset().top - ul.offset().top < 0) { |
|
28 ul.animate({ |
|
29 'scrollTop': ul.scrollTop() + li.offset().top - ul.offset().top |
|
30 }); |
|
31 } else if(li.offset().top + li.outerHeight() - ul.offset().top > ul.outerHeight()) { |
|
32 ul.animate({ |
|
33 'scrollTop': ul.scrollTop() + li.offset().top + li.outerHeight() - ul.offset().top - ul.height() |
|
34 }); |
|
35 } |
|
36 } |
|
37 }), |
22 |
38 |
23 init: function() { |
39 init: function() { |
24 this._super(...arguments); |
40 this._super(...arguments); |
25 }, |
41 }, |
26 |
42 |