Created
July 16, 2015 23:25
-
-
Save rounders/7591bcc7c7aac95f0e8f to your computer and use it in GitHub Desktop.
ember component
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'` | |
SavedIndicatorComponent = Ember.Component.extend | |
_saveCount: 0 | |
attrs: | |
saveCount: 0 | |
duration: 2000 | |
attributeBindings: ['style'] | |
style: 'display: none;'.htmlSafe() | |
didUpdateAttrs: -> | |
if @getAttr('saveCount') != @get('_saveCount') | |
@set('_saveCount', @getAttr('saveCount')) | |
@show() | |
show: -> | |
Ember.run.scheduleOnce 'afterRender', @, -> | |
@$().fadeIn() | |
Ember.run.later @, (-> | |
@$().fadeOut() | |
), @getAttr('duration') | |
`export default SavedIndicatorComponent` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment