This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/views/star-button.js.es6
2014-06-23 12:37:38 -04:00

22 lines
550 B
JavaScript

import ButtonView from 'discourse/views/button';
export default ButtonView.extend({
classNames: ['star'],
textKey: 'starred.title',
helpKeyBinding: 'controller.starTooltipKey',
attributeBindings: ['disabled'],
shouldRerender: Discourse.View.renderIfChanged('controller.starred'),
click: function() {
this.get('controller').send('toggleStar');
},
renderIcon: function(buffer) {
buffer.push("<i class='fa fa-star " +
(this.get('controller.starred') ? ' starred' : '') +
"'></i>");
}
});