Last active
August 29, 2015 14:14
-
-
Save typeoneerror/090a573b9e8f69123d4b to your computer and use it in GitHub Desktop.
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({ | |
tagName: 'div', | |
classNames: 'btn-toolbar-affix', | |
attributeBindings: [ | |
'dataSpy:data-spy', | |
'dataOffsetTop:data-offset-top' | |
], | |
dataSpy: 'affix', | |
dataOffsetTop: 0, | |
dataOffsetBottom: null, | |
didInsertElement: function() { | |
var options = { | |
offset: { | |
top: this.get('dataOffsetTop'), | |
bottom: this.get('dataOffsetBottom') | |
} | |
}; | |
this.$().affix(options); | |
} | |
}); |
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
// components/help-text.js | |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
action: 'doHelpForTopic', | |
helpText: 'Need help?', | |
text: null, | |
topic: null, | |
tagName: 'help-text', | |
classNames: ['help-text'], | |
layout: Ember.Handlebars.compile('{{text}} <a href="#" class="help-link nyi" {{action "doHelp"}}>{{helpText}}</a>'), | |
actions: { | |
doHelp: function() { | |
this.sendAction('action', this.topic); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment