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/buttons/button_view.js
2013-07-11 16:39:35 -04:00

32 lines
673 B
JavaScript

/**
This view handles rendering of a button
@class ButtonView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.ButtonView = Discourse.View.extend({
tagName: 'button',
classNameBindings: [':btn', ':standard', 'dropDownToggle'],
attributeBindings: ['title', 'data-toggle', 'data-share-url'],
title: function() {
return I18n.t(this.get('helpKey') || this.get('textKey'));
}.property('helpKey'),
text: function() {
return I18n.t(this.get('textKey'));
}.property('textKey'),
render: function(buffer) {
if (this.renderIcon) {
this.renderIcon(buffer);
}
buffer.push(this.get('text'));
}
});