Created
January 19, 2016 18:25
-
-
Save dstaley/4583e74a915c5a5e73b5 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains 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({ | |
appName:'Ember Twiddle', | |
images: [ | |
{'id': 0, 'name':'first', 'src': 'https://i.imgur.com/uQbAV8a.gif'}, | |
{'id': 1, 'name':'second', 'src': 'http://replygif.net/i/715.gif'}, | |
{'id': 2, 'name':'third', 'src': 'http://25.media.tumblr.com/tumblr_lovjrlNfbB1qaxm3co6_500.gif'} | |
] | |
}); |
This file contains 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 function equalsHelper(params/*, hash*/) { | |
return params[0] === params[1]; | |
} | |
export default Ember.Helper.helper(equalsHelper); |
This file contains 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.Component.extend({ | |
currentImage: 0, | |
currentImageSrc: Ember.computed('currentImage', function() { | |
return this.images[this.currentImage].src; | |
}), | |
actions: { | |
setCurrentImage(id) { | |
this.set('currentImage', id); | |
} | |
} | |
}); |
This file contains 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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.image { | |
height: 50px; | |
width: 50px; | |
border: 1px solid black; | |
display: inline-block; | |
margin: 10px; | |
} | |
.image.active { | |
border: 2px solid red; | |
} | |
.product-image-current-image { | |
display: block; | |
} |
This file contains 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
{ | |
"version": "0.5.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.2.0/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment