mirror of
https://github.com/discourse/discourse.git
synced 2025-01-29 13:53:59 +08:00
32 lines
724 B
JavaScript
32 lines
724 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: ['data-not-implemented', 'title', 'data-toggle', 'data-share-url'],
|
|
|
|
title: (function() {
|
|
return Em.String.i18n(this.get('helpKey') || this.get('textKey'));
|
|
}).property('helpKey'),
|
|
|
|
text: (function() {
|
|
return Em.String.i18n(this.get('textKey'));
|
|
}).property('textKey'),
|
|
|
|
render: function(buffer) {
|
|
if (this.renderIcon) {
|
|
this.renderIcon(buffer);
|
|
}
|
|
return buffer.push(this.get('text'));
|
|
}
|
|
|
|
});
|
|
|
|
|