Forked from kyleshevlin/add-color-box.component.js
Last active
March 11, 2016 11:13
-
-
Save HenryVonfire/7d9c8f45e106c39abe46 to your computer and use it in GitHub Desktop.
Discuss.emberjs example
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.Component.extend({ | |
classNames: ['add_color_box'], | |
actions: { | |
addColorBox() { | |
this.get('addColorBox')(); | |
} | |
} | |
}); |
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({ | |
appName: 'Ember Twiddle', | |
backgroundColors: ['#112233', '#aabbcc', '#11aa22'], | |
actions:{ | |
addColorBox(){ | |
this.get('backgroundColors').pushObject('#22bb33'); | |
} | |
} | |
}); |
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.Component.extend({ | |
backgroundColor: '#bada55', | |
classNames: ['color_box'], | |
actions: { | |
destroyBox() { | |
this.destroy(); | |
} | |
} | |
}); |
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
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.color_box { | |
display: inline-block; | |
width: 100px; | |
height: 100px; | |
border: 1px solid #ddd; | |
overflow: hidden; | |
position: relative; | |
} | |
.color_box-box { | |
width: 100%; | |
height: 100%; | |
} | |
.color_box-input { | |
width: 100%; | |
background: transparent; | |
border: none; | |
font-size: 15px; | |
text-align: center; | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); | |
} | |
.color_box-button { | |
position: absolute; | |
top: 5px; | |
right: 5px; | |
} |
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
{ | |
"version": "0.6.3", | |
"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.4.1/ember.debug.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.0/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.1/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment