Last active
August 29, 2015 14:19
-
-
Save jdcauley/06e9204638c5c794df80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
main: function(){ | |
return this.store.find('post'); | |
}.property(), | |
actions: { | |
search: function(){ | |
var terms = this.get('terms'); | |
this.store.unloadAll('post'); | |
return this.store.find('post', {terms: terms}); | |
}, | |
next: function(){ | |
var count = this.store.all('post').get('length'); | |
this.store.find('post', {count: 4, offset: count}); | |
}, | |
play: function(post){ | |
var string = '#' + post.get('vineid'); | |
$(string).get(0).paused ? $(string).get(0).play() : $(string).get(0).pause(); | |
var playCount = this.store.createRecord('post', { | |
play: 1, | |
}); | |
playCount.save(); | |
}, | |
mute: function(post) { | |
var vid = '#' + post.get('vineid'); | |
$(vid).prop('muted', !$(vid).prop('muted')); | |
this.set('isMuted', !this.get('isMuted')); | |
}, | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment