4 * base class for bootstrap elements.
8 Roo.bootstrap = Roo.bootstrap || {};
10 * @class Roo.bootstrap.Component
11 * @extends Roo.Component
12 * Bootstrap Component base class
13 * @cfg {String} cls css class
14 * @cfg {String} style any extra css
15 * @cfg {Object} xattr extra attributes to add to 'element' (used by builder to store stuff.)
19 * Do not use directly - it does not do anything..
20 * @param {Object} config The config object
25 Roo.bootstrap.Component = function(config){
26 Roo.bootstrap.Component.superclass.constructor.call(this, config);
29 Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, {
37 initEvents : function() { },
44 // returns the parent component..
45 return Roo.ComponentMgr.get(this.parentId)
51 onRender : function(ct, position)
53 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
58 var cfg = Roo.apply({}, this.getAutoCreate());
62 for (var i in xattr) {
68 cfg.cls += ' ' + this.cls;
70 if (this.style) { // fixme needs to support more complex style data.
71 cfg.style = this.style;
73 this.el = ct.createChild(cfg, position);
74 if(this.tabIndex !== undefined){
75 this.el.dom.setAttribute('tabIndex', this.tabIndex);
82 getChildContainer : function()
87 addxtype : function (tree, cntr) {
89 cntr = typeof(cntr == 'undefined' ) ? 'getChildContainer' : cntr;
91 if (tree.xtype != 'Body') {
93 cn = Roo.factory(tree);
95 cn.parentType = this.xtype; //??
96 cn.parentId = this.id;
97 cn.render(this[cntr]());
98 // then add the element..
101 if (typeof (tree.menu) != 'undefined') {
102 tree.menu.parentType = cn.xtype;
103 tree.menu.triggerEl = cn.el;
104 nitems.push(cn.addxtype(Roo.apply({}, tree.menu)));
107 if (typeof (tree.buttons) != 'undefined' && typeof(cn.getButtonContainer) == 'function') {
109 for(var i =0;i < tree.buttons.length;i++) {
110 nitems.push(cn.addxtype(Roo.apply({}, tree.buttons[i]), 'getButtonContainer'));
115 if (!tree.items || !tree.items.length) {
119 var items = tree.items;
122 //Roo.log(items.length);
124 for(var i =0;i < items.length;i++) {
125 nitems.push(cn.addxtype(Roo.apply({}, items[i])));
145 Roo.bootstrap.Body = function(config){
146 Roo.bootstrap.Body.superclass.constructor.call(this, config);
149 Roo.extend(Roo.bootstrap.Body, Roo.bootstrap.Component, {
154 onRender : function(ct, position){
155 this.el = Roo.get(document.body);
157 //this.el.addClass([this.fieldClass, this.cls]);
175 * @class Roo.bootstrap.ButtonGroup
176 * @extends Roo.bootstrap.Component
177 * Bootstrap ButtonGroup class
178 * @cfg {String} size lg | sm | xs (default empty normal)
179 * @cfg {String} align vertical | justified (default none)
180 * @cfg {String} direction up | down (default down)
181 * @cfg {Boolean} toolbar false | true
182 * @cfg {Boolean} btn true | false
187 * @param {Object} config The config object
190 Roo.bootstrap.ButtonGroup = function(config){
191 Roo.bootstrap.ButtonGroup.superclass.constructor.call(this, config);
194 Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, {
202 getAutoCreate : function(){
208 cfg.html = this.html || cfg.html;
219 if (['vertical','justified'].indexOf(this.align)!==-1) {
220 cfg.cls = 'btn-group-' + this.align;
222 if (this.align == 'justified') {
223 console.log(this.items);
227 if (['lg','sm','xs'].indexOf(this.size)!==-1) {
228 cfg.cls += ' btn-group-' + this.size;
231 if (this.direction == 'up') {
232 cfg.cls += ' dropup' ;
248 * @class Roo.bootstrap.Button
249 * @extends Roo.bootstrap.Component
250 * Bootstrap Button class
251 * @cfg {String} html The button content
252 * @cfg {String} weight default (or empty) | primary | success | info | warning | danger
253 * @cfg {String} size empty | lg | sm | xs
254 * @cfg {String} tag empty | a | input | submit
255 * @cfg {String} href empty or href
256 * @cfg {Boolean} disabled false | true
257 * @cfg {Boolean} isClose false | true
258 * @cfg {String} glyphicon empty | adjust | align-center | align-justify | align-left | align-right | arrow-down | arrow-left | arrow-right | arrow-up | asterisk | backward | ban-circle | barcode | bell | bold | book | bookmark | briefcase | bullhorn | calendar | camera | certificate | check | chevron-down | chevron-left | chevron-right | chevron-up | circle-arrow-down | circle-arrow-left | circle-arrow-right | circle-arrow-up | cloud | cloud-download | cloud-upload | cog | collapse-down | collapse-up | comment | compressed | copyright-mark | credit-card | cutlery | dashboard | download | download-alt | earphone | edit | eject | envelope | euro | exclamation-sign | expand | export | eye-close | eye-open | facetime-video | fast-backward | fast-forward | file | film | filter | fire | flag | flash | floppy-disk | floppy-open | floppy-remove | floppy-save | floppy-saved | folder-close | folder-open | font | forward | fullscreen | gbp | gift | glass | globe | hand-down | hand-left | hand-right | hand-up | hd-video | hdd | header | headphones | heart | heart-empty | home | import | inbox | indent-left | indent-right | info-sign | italic | leaf | link | list | list-alt | lock | log-in | log-out | magnet | map-marker | minus | minus-sign | move | music | new-window | off | ok | ok-circle | ok-sign | open | paperclip | pause | pencil | phone | phone-alt | picture | plane | play | play-circle | plus | plus-sign | print | pushpin | qrcode | question-sign | random | record | refresh | registration-mark | remove | remove-circle | remove-sign | repeat | resize-full | resize-horizontal | resize-small | resize-vertical | retweet | road | save | saved | screenshot | sd-video | search | send | share | share-alt | shopping-cart | signal | sort | sort-by-alphabet | sort-by-alphabet-alt | sort-by-attributes | sort-by-attributes-alt | sort-by-order | sort-by-order-alt | sound-5-1 | sound-6-1 | sound-7-1 | sound-dolby | sound-stereo | star | star-empty | stats | step-backward | step-forward | stop | subtitles | tag | tags | tasks | text-height | text-width | th | th-large | th-list | thumbs-down | thumbs-up | time | tint | tower | transfer | trash | tree-conifer | tree-deciduous | unchecked | upload | usd | user | volume-down | volume-off | volume-up | warning-sign | wrench | zoom-in | zoom-out
259 * @cfg {String} badge text for badge
260 * @cfg {String} theme default (or empty) | glow
261 * @cfg {Boolean} inverse false | true
262 * @cfg {Boolean} toggle false | true
263 * @cfg {String} ontext text for on toggle state
264 * @cfg {String} offtext text for off toggle state
265 * @cfg {Boolean} defaulton true | false
268 * Create a new button
269 * @param {Object} config The config object
273 Roo.bootstrap.Button = function(config){
274 Roo.bootstrap.Button.superclass.constructor.call(this, config);
279 * The raw click event for the entire grid.
280 * @param {Roo.EventObject} e
286 Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, {
305 getAutoCreate : function(){
312 if (['a', 'button', 'input', 'submit'].indexOf(this.tag) < 0) {
313 throw "Invalid value for tag: " + this.tag + ". must be a, button, input or submit.";
318 cfg.html = this.html || cfg.html;
320 if (this.toggle===true) {
328 'data-off-text':'OFF',
329 cls: 'slider-button',
335 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
336 cfg.cls += ' '+this.weight;
345 cfg["aria-hidden"] = true;
347 cfg.html = "×";
353 if (this.theme==='default') {
356 if (this.parentType != 'Navbar') {
357 this.weight = this.weight.length ? this.weight : 'default';
359 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
361 cfg.cls += ' btn-' + this.weight;
363 } else if (this.theme==='glow') {
368 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
370 cfg.cls += ' ' + this.weight;
376 this.cls += ' inverse';
381 cfg.cls += ' active';
384 cfg.cls += this.size.length ? (' btn-' + this.size) : '';
386 //gsRoo.log(this.parentType);
387 if (this.parentType === 'Navbar') {
394 href : this.href || '#'
397 cfg.cn[0].html = this.html + ' <span class="caret"></span>';
398 cfg.cls += ' dropdown';
403 } else if (this.menu) {
405 cfg.cls += ' dropdown test';
411 cfg.disabled = 'disabled';
415 Roo.log('changing to ul' );
417 this.glyphicon = 'caret';
420 if (this.glyphicon) {
421 cfg.html = ' ' + cfg.html;
426 cls: 'glyphicon glyphicon-' + this.glyphicon
452 if (cfg.tag !== 'a' && this.href !== '') {
453 throw "Tag must be a to set href.";
454 } else if (this.href.length > 0) {
455 cfg.href = this.href;
460 initEvents: function() {
461 // Roo.log('init events?');
462 // Roo.log(this.el.dom);
463 this.el.select('a',true).on('click',
465 this.fireEvent('click', this);
481 * @class Roo.bootstrap.Column
482 * @extends Roo.bootstrap.Component
483 * Bootstrap Column class
484 * @cfg {Number} xs colspan out of 12 for mobile-sized screens
485 * @cfg {Number} sm colspan out of 12 for tablet-sized screens
486 * @cfg {Number} md colspan out of 12 for computer-sized screens
487 * @cfg {Number} lg colspan out of 12 for large computer-sized screens
488 * @cfg {String} html content of column.
491 * Create a new Column
492 * @param {Object} config The config object
495 Roo.bootstrap.Column = function(config){
496 Roo.bootstrap.Column.superclass.constructor.call(this, config);
499 Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component, {
508 getAutoCreate : function(){
509 var cfg = Roo.apply({}, Roo.bootstrap.Column.superclass.getAutoCreate.call(this));
517 ['xs','sm','md','lg'].map(function(size){
518 if (settings[size]) {
519 cfg.cls += ' col-' + size + '-' + settings[size];
522 if (this.html.length) {
523 cfg.html = this.html;
542 * @class Roo.bootstrap.Container
543 * @extends Roo.bootstrap.Component
544 * Bootstrap Container class
545 * @cfg {Boolean} jumbotron is it a jumbotron element
546 * @cfg {String} html content of element
547 * @cfg {String} well (lg|sm|md) a well, large, small or medium.
548 * @cfg {String} panel (primary|success|info|warning|danger) render as a panel.
549 * @cfg {String} header content of header (for panel)
550 * @cfg {String} footer content of footer (for panel)
551 * @cfg {String} sticky (footer|wrap|push) block to use as footer or body- needs css-bootstrap/sticky-footer.css
554 * Create a new Container
555 * @param {Object} config The config object
558 Roo.bootstrap.Container = function(config){
559 Roo.bootstrap.Container.superclass.constructor.call(this, config);
562 Roo.extend(Roo.bootstrap.Container, Roo.bootstrap.Component, {
572 getChildContainer : function() {
573 if (this.panel.length) {
574 return this.el.select('.panel-body',true).first();
581 getAutoCreate : function(){
587 if (this.jumbotron) {
588 cfg.cls = 'jumbotron';
591 cfg.cls = this.cls + '';
594 if (this.sticky.length) {
595 var bd = Roo.get(document.body)
596 if (!bd.hasClass('bootstrap-sticky')) {
597 bd.addClass('bootstrap-sticky');
598 Roo.select('html',true).setStyle('height', '100%');
601 cfg.cls += 'bootstrap-sticky-' + this.sticky;
605 if (this.well.length) {
609 cfg.cls +=' well well-' +this.well;
619 if (this.panel.length) {
620 cfg.cls += 'panel panel-' + this.panel;
622 if (this.header.length) {
625 cls : 'panel-heading',
641 if (this.footer.length) {
643 cls : 'panel-footer',
651 body.html = this.html || cfg.html;
653 if (!cfg.cls.length) {
654 cfg.cls = 'container';
670 * @class Roo.bootstrap.Form
671 * @extends Roo.bootstrap.Component
672 * Bootstrap Form class
673 * @cfg {String} method GET | POST (default POST)
674 * @cfg {String} labelAlign top | left (default top)
678 * @param {Object} config The config object
682 Roo.bootstrap.Form = function(config){
683 Roo.bootstrap.Form.superclass.constructor.call(this, config);
686 * @event clientvalidation
687 * If the monitorValid config option is true, this event fires repetitively to notify of valid state
689 * @param {Boolean} valid true if the form has passed client-side validation
691 clientvalidation: true,
694 * Fires when the form is rendered
695 * @param {Roo.form.Form} form
701 Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, {
704 getAutoCreate : function(){
708 method : this.method || 'POST',
709 id : this.id || Roo.id(),
713 if (this.labelAlign == 'left' ) {
714 cfg.cls += ' form-horizontal';
731 * @class Roo.bootstrap.Img
732 * @extends Roo.bootstrap.Component
733 * Bootstrap Img class
734 * @cfg {Boolean} imgResponsive false | true
735 * @cfg {String} border rounded | circle | thumbnail
736 * @cfg {String} src image source
737 * @cfg {String} alt image alternative text
741 * @param {Object} config The config object
744 Roo.bootstrap.Img = function(config){
745 Roo.bootstrap.Img.superclass.constructor.call(this, config);
748 Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, {
754 getAutoCreate : function(){
758 cls: 'img-responsive',
762 cfg.html = this.html || cfg.html;
764 cfg.src = this.src || cfg.src;
766 if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) {
767 cfg.cls += ' img-' + this.border;
787 * @class Roo.bootstrap.Input
788 * @extends Roo.bootstrap.Component
789 * Bootstrap Input class
790 * @cfg {Boolean} disabled is it disabled
791 * @cfg {String} fieldLabel - the label associated
792 * @cfg {String} inputType button | checkbox | email | file | hidden | image | number | password | radio | range | reset | search | submit | text
793 * @cfg {String} name name of the input
794 * @cfg {boolean} disabled is it disabled
795 * @cfg {string} fieldLabel - the label associated
796 * @cfg {string} inputType - input / file submit ...
797 * @cfg {string} placeholder - placeholder to put in text.
798 * @cfg {string} before - input group add on before
799 * @cfg {string} after - input group add on after
804 * @param {Object} config The config object
807 Roo.bootstrap.Input = function(config){
808 Roo.bootstrap.Input.superclass.constructor.call(this, config);
812 Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component, {
822 getAutoCreate : function(){
824 var parent = this.parent();
826 var align = parent.labelAlign;
831 cls: 'form-group' //input-group
837 type : this.inputType,
838 cls : 'form-control',
839 placeholder : this.placeholder || ''
846 var inputblock = input;
848 if (this.before || this.after) {
857 cls : 'input-group-addon',
861 inputblock.cn.push(input);
865 cls : 'input-group-addon',
873 Roo.log(this.fieldLabel.length);
875 if (align ==='left' && this.fieldLabel.length) {
876 Roo.log("left and has label");
882 cls : 'col-sm-2 control-label',
883 html : this.fieldLabel
894 } else if ( this.fieldLabel.length) {
900 //cls : 'input-group-addon',
901 html : this.fieldLabel
911 Roo.log(" no label && no align");
930 setDisabled : function(v)
932 var i = this.el.select('input',true).dom;
934 i.removeAttribute('disabled');
938 i.setAttribute('disabled','true');
951 * @class Roo.bootstrap.Header
952 * @extends Roo.bootstrap.Component
953 * Bootstrap Header class
954 * @cfg {String} html content of header
955 * @cfg {Number} level (1|2|3|4|5|6) default 1
958 * Create a new Header
959 * @param {Object} config The config object
963 Roo.bootstrap.Header = function(config){
964 Roo.bootstrap.Header.superclass.constructor.call(this, config);
967 Roo.extend(Roo.bootstrap.Header, Roo.bootstrap.Component, {
975 getAutoCreate : function(){
978 tag: 'h' + (1 *this.level),
979 html: this.html || 'fill in html'
997 * @class Roo.bootstrap.Menu
998 * @extends Roo.bootstrap.Component
999 * Bootstrap Menu class - container for MenuItems
1000 * @cfg {String} type type of menu
1004 * @param {Object} config The config object
1008 Roo.bootstrap.Menu = function(config){
1009 Roo.bootstrap.Menu.superclass.constructor.call(this, config);
1012 Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component, {
1020 getChildContainer : function() {
1024 getAutoCreate : function(){
1026 //if (['right'].indexOf(this.align)!==-1) {
1027 // cfg.cn[1].cls += ' pull-right'
1031 cls : 'dropdown-menu'
1035 if (this.type==='submenu') {
1036 cfg.cls='submenu active'
1041 initEvents : function() {
1042 // Roo.log("ADD event");
1043 // Roo.log(this.triggerEl.dom);
1044 this.triggerEl.on('click', this.toggle, this);
1045 this.triggerEl.addClass('dropdown-toggle');
1048 toggle : function(e)
1050 //Roo.log(e.getTarget());
1051 // Roo.log(this.triggerEl.dom);
1052 if (Roo.get(e.getTarget()).findParent('.dropdown-menu')) {
1055 var isActive = this.triggerEl.hasClass('open');
1056 // if disabled.. ingore
1058 //if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
1059 // if mobile we use a backdrop because click events don't delegate
1060 // $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
1063 //var relatedTarget = { relatedTarget: this }
1064 //$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
1066 //if (e.isDefaultPrevented()) return;
1068 this.triggerEl[isActive ? 'removeClass' : 'addClass']('open');
1070 // .trigger('shown.bs.dropdown', relatedTarget)
1072 this.triggerEl.focus();
1078 clearMenus : function()
1080 //$(backdrop).remove()
1081 Roo.select('.dropdown-toggle',true).each(function(aa) {
1082 if (!aa.hasClass('open')) {
1086 aa.removeClass('open');
1087 //var parent = getParent($(this))
1088 //var relatedTarget = { relatedTarget: this }
1090 //$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
1091 //if (e.isDefaultPrevented()) return
1092 //$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
1110 * @class Roo.bootstrap.MenuItem
1111 * @extends Roo.bootstrap.Component
1112 * Bootstrap MenuItem class
1113 * @cfg {String} html the menu label
1114 * @cfg {String} href the link
1118 * Create a new MenuItem
1119 * @param {Object} config The config object
1123 Roo.bootstrap.MenuItem = function(config){
1124 Roo.bootstrap.MenuItem.superclass.constructor.call(this, config);
1127 Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
1132 getAutoCreate : function(){
1144 cfg.cn[0].href = this.href || cfg.cn[0].href ;
1145 cfg.cn[0].html = this.html || cfg.cn[0].html ;
1162 * @class Roo.bootstrap.MenuSeparator
1163 * @extends Roo.bootstrap.Component
1164 * Bootstrap MenuSeparator class
1167 * Create a new MenuItem
1168 * @param {Object} config The config object
1172 Roo.bootstrap.MenuSeparator = function(config){
1173 Roo.bootstrap.MenuSeparator.superclass.constructor.call(this, config);
1176 Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component, {
1178 getAutoCreate : function(){
1193 <div class="modal fade">
1194 <div class="modal-dialog">
1195 <div class="modal-content">
1196 <div class="modal-header">
1197 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
1198 <h4 class="modal-title">Modal title</h4>
1200 <div class="modal-body">
1201 <p>One fine body…</p>
1203 <div class="modal-footer">
1204 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1205 <button type="button" class="btn btn-primary">Save changes</button>
1207 </div><!-- /.modal-content -->
1208 </div><!-- /.modal-dialog -->
1209 </div><!-- /.modal -->
1219 * @class Roo.bootstrap.Modal
1220 * @extends Roo.bootstrap.Component
1221 * Bootstrap Modal class
1222 * @cfg {String} title Title of dialog
1223 * @cfg {Array} buttons Array of buttons
1226 * Create a new Modal Dialog
1227 * @param {Object} config The config object
1230 Roo.bootstrap.Modal = function(config){
1231 Roo.bootstrap.Modal.superclass.constructor.call(this, config);
1234 Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, {
1236 title : 'test dialog',
1240 onRender : function(ct, position)
1242 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
1244 var cfg = Roo.apply({}, this.getAutoCreate());
1247 // cfg.name = typeof(this.name) == 'undefined' ? this.id : this.name;
1249 //if (!cfg.name.length) {
1253 cfg.cls += ' ' + this.cls;
1256 cfg.style = this.style;
1258 this.el = Roo.get(document.body).createChild(cfg, position);
1260 //var type = this.el.dom.type;
1262 if(this.tabIndex !== undefined){
1263 this.el.dom.setAttribute('tabIndex', this.tabIndex);
1266 //this.el.addClass([this.fieldClass, this.cls]);
1269 getAutoCreate : function(){
1275 cls: "modal-dialog",
1278 cls : "modal-content",
1281 cls : 'modal-header',
1290 cls : 'modal-title',
1301 cls : 'modal-footer'
1306 cls : 'btn btn-default',
1311 cls : 'btn btn-primary',
1332 getChildContainer : function() {
1334 return this.el.select('.modal-body',true).first();
1337 getButtonContainer : function() {
1338 return this.el.select('.modal-footer',true).first();
1341 initEvents : function()
1343 this.el.select('.modal-header .close').on('click', this.hide, this);
1346 this.el.addClass('on');
1347 this.el.removeClass('fade');
1348 this.el.setStyle('display', 'block');
1351 this.el.removeClass('on');
1352 this.el.addClass('fade');
1353 this.el.setStyle('display', 'none');
1365 * @class Roo.bootstrap.Navbar
1366 * @extends Roo.bootstrap.Component
1367 * Bootstrap Navbar class
1368 * @cfg {Boolean} sidebar has side bar
1369 * @cfg {Boolean} bar is a bar?
1370 * @cfg {String} position (fixed-top|fixed-bottom|static-top) position
1371 * @cfg {String} brand what is brand
1372 * @cfg {Boolean} inverse is inverted color
1373 * @cfg {String} type (nav | pills | tabs)
1374 * @cfg {Boolean} arrangement stacked | justified
1375 * @cfg {String} align (left | right) alignment
1379 * Create a new Navbar
1380 * @param {Object} config The config object
1384 Roo.bootstrap.Navbar = function(config){
1385 Roo.bootstrap.Navbar.superclass.constructor.call(this, config);
1388 Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, {
1400 getAutoCreate : function(){
1405 if (this.sidebar === true) {
1413 if (this.bar === true) {
1421 cls: 'navbar-header',
1426 cls: 'navbar-toggle',
1427 'data-toggle': 'collapse',
1432 html: 'Toggle navigation'
1452 cls: 'collapse navbar-collapse'
1457 cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
1459 if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) {
1460 cfg.cls += ' navbar-' + this.position;
1461 cfg.tag = this.position == 'fixed-bottom' ? 'footer' : 'header';
1464 if (this.brand !== '') {
1468 cls: 'navbar-brand',
1477 } else if (this.bar === false) {
1480 Roo.log('Property \'bar\' in of Navbar must be either true or false')
1490 if (['tabs','pills'].indexOf(this.type)!==-1) {
1491 cfg.cn[0].cls += ' nav-' + this.type
1493 if (this.type!=='nav') {
1494 Roo.log('nav type must be nav/tabs/pills')
1496 cfg.cn[0].cls += ' navbar-nav'
1499 if (['stacked','justified'].indexOf(this.arrangement)!==-1) {
1500 cfg.cn[0].cls += ' nav-' + this.arrangement;
1503 if (this.align === 'right') {
1504 cfg.cn[0].cls += ' navbar-right';
1507 cfg.cls += ' navbar-inverse';
1515 getChildContainer : function() {
1516 if (this.bar === true) {
1517 return this.el.select('.collapse',true).first();
1535 * @class Roo.bootstrap.NavGroup
1536 * @extends Roo.bootstrap.Component
1537 * Bootstrap NavGroup class
1538 * @cfg {String} align left | right
1539 * @cfg {Boolean} inverse false | true
1542 * Create a new nav group
1543 * @param {Object} config The config object
1546 Roo.bootstrap.NavGroup = function(config){
1547 Roo.bootstrap.NavGroup.superclass.constructor.call(this, config);
1550 Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component, {
1556 getAutoCreate : function(){
1557 var cfg = Roo.apply({}, Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));
1561 cls: 'nav navbar-nav'
1564 if (this.parent().sidebar === true) {
1567 cls: 'dashboard-menu'
1573 if (this.form === true) {
1579 if (this.align === 'right') {
1580 cfg.cls += ' navbar-right';
1582 cfg.cls += ' navbar-left';
1587 if (this.align === 'right') {
1588 cfg.cls += ' navbar-right';
1592 cfg.cls += ' navbar-inverse';
1611 * @class Roo.bootstrap.Navbar.Button
1612 * @extends Roo.bootstrap.Component
1613 * Bootstrap Navbar.Button class
1614 * @cfg {String} href link to
1615 * @cfg {String} html content of button
1618 * Create a new Navbar Button
1619 * @param {Object} config The config object
1623 Roo.bootstrap.Navbar.Button = function(config){
1624 Roo.bootstrap.Navbar.Button.superclass.constructor.call(this, config);
1627 Roo.extend(Roo.bootstrap.Navbar.Button, Roo.bootstrap.Component, {
1638 getAutoCreate : function(){
1648 html : this.html || ''
1672 * @class Roo.bootstrap.Navbar.Item
1673 * @extends Roo.bootstrap.Component
1674 * Bootstrap Navbar.Button class
1675 * @cfg {String} href link to
1676 * @cfg {String} html content of button
1677 * @cfg {String} badge text inside badge
1678 * @cfg {String} glyphicon name of glyphicon
1681 * Create a new Navbar Button
1682 * @param {Object} config The config object
1684 Roo.bootstrap.Navbar.Item = function(config){
1685 Roo.bootstrap.Navbar.Item.superclass.constructor.call(this, config);
1688 Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component, {
1696 getAutoCreate : function(){
1698 var cfg = Roo.apply({}, Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));
1700 if (this.parent().parent().sidebar === true) {
1713 cfg.cn[0].html = this.html;
1717 this.cls += ' active';
1721 cfg.cn[0].cls += ' dropdown-toggle';
1722 cfg.cn[0].html = (cfg.cn[0].html || this.html) + '<span class="glyphicon glyphicon-chevron-down"></span>';
1726 cfg.cn[0].tag = 'a',
1727 cfg.cn[0].href = this.href;
1730 if (this.glyphicon) {
1731 cfg.cn[0].html = '<i class="glyphicon glyphicon-'+this.glyphicon+'"></i><span>' + cfg.cn[0].html || this.html + '</span>'
1747 if (this.glyphicon) {
1748 if(cfg.html){cfg.html = ' ' + this.html};
1752 cls: 'glyphicon glyphicon-' + this.glyphicon
1757 cfg.cn[0].html = this.html || cfg.cn[0].html ;
1761 cfg.cn[0].html += " <span class='caret'></span>";
1762 //}else if (!this.href) {
1763 // cfg.cn[0].tag='p';
1764 // cfg.cn[0].cls='navbar-text';
1767 cfg.cn[0].href=this.href||'#';
1768 cfg.cn[0].html=this.html;
1771 if (this.badge !== '') {
1774 cfg.cn[0].html + ' ',
1787 initEvents: function() {
1788 // Roo.log('init events?');
1789 // Roo.log(this.el.dom);
1790 this.el.select('a',true).on('click',
1792 this.fireEvent('click', this);
1809 * @class Roo.bootstrap.Row
1810 * @extends Roo.bootstrap.Component
1811 * Bootstrap Row class (contains columns...)
1815 * @param {Object} config The config object
1818 Roo.bootstrap.Row = function(config){
1819 Roo.bootstrap.Row.superclass.constructor.call(this, config);
1822 Roo.extend(Roo.bootstrap.Row, Roo.bootstrap.Component, {
1841 * @class Roo.bootstrap.Element
1842 * @extends Roo.bootstrap.Component
1843 * Bootstrap Element class
1844 * @cfg {String} html contents of the element
1845 * @cfg {String} tag tag of the element
1846 * @cfg {String} cls class of the element
1849 * Create a new Element
1850 * @param {Object} config The config object
1853 Roo.bootstrap.Element = function(config){
1854 Roo.bootstrap.Element.superclass.constructor.call(this, config);
1857 Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component, {
1865 getAutoCreate : function(){
1866 var cfg = Roo.apply({}, Roo.bootstrap.Element.superclass.getAutoCreate.call(this));
1889 * @class Roo.bootstrap.Pagination
1890 * @extends Roo.bootstrap.Component
1891 * Bootstrap Pagination class
1892 * @cfg {String} size xs | sm | md | lg
1893 * @cfg {Boolean} inverse false | true
1894 * @cfg {Number} from pagination starting number
1895 * @cfg {Number} to pagination ending number
1896 * @cfg {String} align empty or left | right
1897 * @cfg {Number} active active page number
1900 * Create a new Pagination
1901 * @param {Object} config The config object
1904 Roo.bootstrap.Pagination = function(config){
1905 Roo.bootstrap.Pagination.superclass.constructor.call(this, config);
1908 Roo.extend(Roo.bootstrap.Pagination, Roo.bootstrap.Component, {
1918 getAutoCreate : function(){
1925 cfg.cls += ' inverse';
1943 var from=this.from>0?this.from:1;
1944 var to=this.to-from<=10?this.to:from+10;
1945 var active=this.active>=from&&this.active<=to?this.active:null;
1946 for (var i=from;i<=to;i++) {
1950 cls: active===i?'active':'',
1991 * @class Roo.bootstrap.Slider
1992 * @extends Roo.bootstrap.Component
1993 * Bootstrap Slider class
1996 * Create a new Slider
1997 * @param {Object} config The config object
2000 Roo.bootstrap.Slider = function(config){
2001 Roo.bootstrap.Slider.superclass.constructor.call(this, config);
2004 Roo.extend(Roo.bootstrap.Slider, Roo.bootstrap.Component, {
2006 getAutoCreate : function(){
2010 cls: 'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',
2014 cls: 'ui-slider-handle ui-state-default ui-corner-all'
2032 * @class Roo.bootstrap.Table
2033 * @extends Roo.bootstrap.Component
2034 * Bootstrap Table class
2037 * Create a new Table
2038 * @param {Object} config The config object
2041 Roo.bootstrap.Table = function(config){
2042 Roo.bootstrap.Table.superclass.constructor.call(this, config);
2045 Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, {
2050 getAutoCreate : function(){
2051 var cfg = Roo.apply({}, Roo.bootstrap.Table.superclass.getAutoCreate.call(this));
2083 * @class Roo.bootstrap.TableCell
2084 * @extends Roo.bootstrap.Component
2085 * Bootstrap TableCell class
2088 * Create a new TableCell
2089 * @param {Object} config The config object
2092 Roo.bootstrap.TableCell = function(config){
2093 Roo.bootstrap.TableCell.superclass.constructor.call(this, config);
2096 Roo.extend(Roo.bootstrap.TableCell, Roo.bootstrap.Component, {
2098 getAutoCreate : function(){
2099 var cfg = Roo.apply({}, Roo.bootstrap.TableCell.superclass.getAutoCreate.call(this));
2126 * @class Roo.bootstrap.TableRow
2127 * @extends Roo.bootstrap.Component
2128 * Bootstrap TableRow class
2131 * Create a new TableRow
2132 * @param {Object} config The config object
2135 Roo.bootstrap.TableRow = function(config){
2136 Roo.bootstrap.TableRow.superclass.constructor.call(this, config);
2139 Roo.extend(Roo.bootstrap.TableRow, Roo.bootstrap.Component, {
2141 getAutoCreate : function(){
2142 var cfg = Roo.apply({}, Roo.bootstrap.TableRow.superclass.getAutoCreate.call(this));