ButtonGroup.js
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* ButtonGroup.js
*
* Released under LGPL License.
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/**
* This control enables you to put multiple buttons into a group. This is
* useful when you want to combine similar toolbar buttons into a group.
*
* @example
* // Create and render a buttongroup with two buttons to the body element
* tinymce.ui.Factory.create({
* type: 'buttongroup',
* items: [
* {text: 'Button A'},
* {text: 'Button B'}
* ]
* }).renderTo(document.body);
*
* @-x-less ButtonGroup.less
* @class tinymce.ui.ButtonGroup
* @extends tinymce.ui.Container
*/
define("tinymce/ui/ButtonGroup", [
"tinymce/ui/Container"
], function(Container) {
"use strict";
return Container.extend({
Defaults: {
defaultType: 'button',
role: 'group'
},
/**
* Renders the control as a HTML string.
*
* @method renderHtml
* @return {String} HTML representing the control.
*/
renderHtml: function() {
var self = this, layout = self._layout;
self.classes.add('btn-group');
self.preRender();
layout.preRender(self);
return (
'<div id="' + self._id + '" class="' + self.classes + '">' +
'<div id="' + self._id + '-body">' +
(self.settings.html || '') + layout.renderHtml(self) +
'</div>' +
'</div>'
);
}
});
});