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);
60 var cfg = Roo.apply({}, this.getAutoCreate());
63 // fill in the extra attributes
64 if (this.xattr && typeof(this.xattr) =='object') {
65 for (var i in this.xattr) {
66 cfg[i] = this.xattr[i];
71 cfg.cls += ' ' + this.cls;
73 if (this.style) { // fixme needs to support more complex style data.
74 cfg.style = this.style;
76 this.el = ct.createChild(cfg, position);
77 if(this.tabIndex !== undefined){
78 this.el.dom.setAttribute('tabIndex', this.tabIndex);
85 getChildContainer : function()
90 addxtype : function (tree, cntr) {
92 cntr = typeof(cntr == 'undefined' ) ? 'getChildContainer' : cntr;
94 // render the element if it's not BODY.
95 if (tree.xtype != 'Body') {
97 cn = Roo.factory(tree);
99 cn.parentType = this.xtype; //??
100 cn.parentId = this.id;
102 // does the container contain child eleemnts with 'xtype' attributes.
103 // that match this xtype..
104 // note - when we render we create these as well..
105 // so we should check to see if body has xtype set.
106 if (Roo.get(document.body).attr('xtype') == 'Roo.Bootstrap.Body') {
108 var echild = Roo.get(this[cntr]()).child('*[xtype]');
111 echild.dom.removeAttribute('xtype');
114 cn.render(this[cntr]());
115 // then add the element..
122 if (typeof (tree.menu) != 'undefined') {
123 tree.menu.parentType = cn.xtype;
124 tree.menu.triggerEl = cn.el;
125 nitems.push(cn.addxtype(Roo.apply({}, tree.menu)));
128 if (typeof (tree.buttons) != 'undefined' && typeof(cn.getButtonContainer) == 'function') {
130 for(var i =0;i < tree.buttons.length;i++) {
131 nitems.push(cn.addxtype(Roo.apply({}, tree.buttons[i]), 'getButtonContainer'));
136 if (!tree.items || !tree.items.length) {
140 var items = tree.items;
143 //Roo.log(items.length);
145 for(var i =0;i < items.length;i++) {
146 nitems.push(cn.addxtype(Roo.apply({}, items[i])));
166 Roo.bootstrap.Body = function(config){
167 Roo.bootstrap.Body.superclass.constructor.call(this, config);
170 Roo.extend(Roo.bootstrap.Body, Roo.bootstrap.Component, {
175 onRender : function(ct, position){
176 this.el = Roo.get(document.body);
178 //this.el.addClass([this.fieldClass, this.cls]);
196 * @class Roo.bootstrap.ButtonGroup
197 * @extends Roo.bootstrap.Component
198 * Bootstrap ButtonGroup class
199 * @cfg {String} size lg | sm | xs (default empty normal)
200 * @cfg {String} align vertical | justified (default none)
201 * @cfg {String} direction up | down (default down)
202 * @cfg {Boolean} toolbar false | true
203 * @cfg {Boolean} btn true | false
208 * @param {Object} config The config object
211 Roo.bootstrap.ButtonGroup = function(config){
212 Roo.bootstrap.ButtonGroup.superclass.constructor.call(this, config);
215 Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component, {
223 getAutoCreate : function(){
229 cfg.html = this.html || cfg.html;
240 if (['vertical','justified'].indexOf(this.align)!==-1) {
241 cfg.cls = 'btn-group-' + this.align;
243 if (this.align == 'justified') {
244 console.log(this.items);
248 if (['lg','sm','xs'].indexOf(this.size)!==-1) {
249 cfg.cls += ' btn-group-' + this.size;
252 if (this.direction == 'up') {
253 cfg.cls += ' dropup' ;
269 * @class Roo.bootstrap.Button
270 * @extends Roo.bootstrap.Component
271 * Bootstrap Button class
272 * @cfg {String} html The button content
273 * @cfg {String} weight default (or empty) | primary | success | info | warning | danger
274 * @cfg {String} size empty | lg | sm | xs
275 * @cfg {String} tag empty | a | input | submit
276 * @cfg {String} href empty or href
277 * @cfg {Boolean} disabled false | true
278 * @cfg {Boolean} isClose false | true
279 * @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
280 * @cfg {String} badge text for badge
281 * @cfg {String} theme default (or empty) | glow
282 * @cfg {Boolean} inverse false | true
283 * @cfg {Boolean} toggle false | true
284 * @cfg {String} ontext text for on toggle state
285 * @cfg {String} offtext text for off toggle state
286 * @cfg {Boolean} defaulton true | false
289 * Create a new button
290 * @param {Object} config The config object
294 Roo.bootstrap.Button = function(config){
295 Roo.bootstrap.Button.superclass.constructor.call(this, config);
300 * The raw click event for the entire grid.
301 * @param {Roo.EventObject} e
307 Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component, {
326 getAutoCreate : function(){
333 if (['a', 'button', 'input', 'submit'].indexOf(this.tag) < 0) {
334 throw "Invalid value for tag: " + this.tag + ". must be a, button, input or submit.";
339 cfg.html = this.html || cfg.html;
341 if (this.toggle===true) {
349 'data-off-text':'OFF',
350 cls: 'slider-button',
356 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
357 cfg.cls += ' '+this.weight;
366 cfg["aria-hidden"] = true;
368 cfg.html = "×";
374 if (this.theme==='default') {
377 if (this.parentType != 'Navbar') {
378 this.weight = this.weight.length ? this.weight : 'default';
380 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
382 cfg.cls += ' btn-' + this.weight;
384 } else if (this.theme==='glow') {
389 if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
391 cfg.cls += ' ' + this.weight;
397 this.cls += ' inverse';
402 cfg.cls += ' active';
405 cfg.cls += this.size.length ? (' btn-' + this.size) : '';
407 //gsRoo.log(this.parentType);
408 if (this.parentType === 'Navbar') {
415 href : this.href || '#'
418 cfg.cn[0].html = this.html + ' <span class="caret"></span>';
419 cfg.cls += ' dropdown';
424 } else if (this.menu) {
426 cfg.cls += ' dropdown test';
432 cfg.disabled = 'disabled';
436 Roo.log('changing to ul' );
438 this.glyphicon = 'caret';
441 if (this.glyphicon) {
442 cfg.html = ' ' + cfg.html;
447 cls: 'glyphicon glyphicon-' + this.glyphicon
473 if (cfg.tag !== 'a' && this.href !== '') {
474 throw "Tag must be a to set href.";
475 } else if (this.href.length > 0) {
476 cfg.href = this.href;
481 initEvents: function() {
482 // Roo.log('init events?');
483 // Roo.log(this.el.dom);
484 this.el.select('a',true).on('click',
486 this.fireEvent('click', this);
502 * @class Roo.bootstrap.Column
503 * @extends Roo.bootstrap.Component
504 * Bootstrap Column class
505 * @cfg {Number} xs colspan out of 12 for mobile-sized screens
506 * @cfg {Number} sm colspan out of 12 for tablet-sized screens
507 * @cfg {Number} md colspan out of 12 for computer-sized screens
508 * @cfg {Number} lg colspan out of 12 for large computer-sized screens
509 * @cfg {String} html content of column.
512 * Create a new Column
513 * @param {Object} config The config object
516 Roo.bootstrap.Column = function(config){
517 Roo.bootstrap.Column.superclass.constructor.call(this, config);
520 Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component, {
529 getAutoCreate : function(){
530 var cfg = Roo.apply({}, Roo.bootstrap.Column.superclass.getAutoCreate.call(this));
538 ['xs','sm','md','lg'].map(function(size){
539 if (settings[size]) {
540 cfg.cls += ' col-' + size + '-' + settings[size];
543 if (this.html.length) {
544 cfg.html = this.html;
563 * @class Roo.bootstrap.Container
564 * @extends Roo.bootstrap.Component
565 * Bootstrap Container class
566 * @cfg {Boolean} jumbotron is it a jumbotron element
567 * @cfg {String} html content of element
568 * @cfg {String} well (lg|sm|md) a well, large, small or medium.
569 * @cfg {String} panel (primary|success|info|warning|danger) render as a panel.
570 * @cfg {String} header content of header (for panel)
571 * @cfg {String} footer content of footer (for panel)
572 * @cfg {String} sticky (footer|wrap|push) block to use as footer or body- needs css-bootstrap/sticky-footer.css
575 * Create a new Container
576 * @param {Object} config The config object
579 Roo.bootstrap.Container = function(config){
580 Roo.bootstrap.Container.superclass.constructor.call(this, config);
583 Roo.extend(Roo.bootstrap.Container, Roo.bootstrap.Component, {
593 getChildContainer : function() {
594 if (this.panel.length) {
595 return this.el.select('.panel-body',true).first();
602 getAutoCreate : function(){
608 if (this.jumbotron) {
609 cfg.cls = 'jumbotron';
612 cfg.cls = this.cls + '';
615 if (this.sticky.length) {
616 var bd = Roo.get(document.body);
617 if (!bd.hasClass('bootstrap-sticky')) {
618 bd.addClass('bootstrap-sticky');
619 Roo.select('html',true).setStyle('height', '100%');
622 cfg.cls += 'bootstrap-sticky-' + this.sticky;
626 if (this.well.length) {
630 cfg.cls +=' well well-' +this.well;
640 if (this.panel.length) {
641 cfg.cls += 'panel panel-' + this.panel;
643 if (this.header.length) {
646 cls : 'panel-heading',
662 if (this.footer.length) {
664 cls : 'panel-footer',
672 body.html = this.html || cfg.html;
674 if (!cfg.cls.length) {
675 cfg.cls = 'container';
691 * @class Roo.bootstrap.Form
692 * @extends Roo.bootstrap.Component
693 * Bootstrap Form class
694 * @cfg {String} method GET | POST (default POST)
695 * @cfg {String} labelAlign top | left (default top)
699 * @param {Object} config The config object
703 Roo.bootstrap.Form = function(config){
704 Roo.bootstrap.Form.superclass.constructor.call(this, config);
707 * @event clientvalidation
708 * If the monitorValid config option is true, this event fires repetitively to notify of valid state
710 * @param {Boolean} valid true if the form has passed client-side validation
712 clientvalidation: true,
715 * Fires when the form is rendered
716 * @param {Roo.form.Form} form
722 Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, {
725 getAutoCreate : function(){
729 method : this.method || 'POST',
730 id : this.id || Roo.id(),
734 if (this.labelAlign == 'left' ) {
735 cfg.cls += ' form-horizontal';
752 * @class Roo.bootstrap.Img
753 * @extends Roo.bootstrap.Component
754 * Bootstrap Img class
755 * @cfg {Boolean} imgResponsive false | true
756 * @cfg {String} border rounded | circle | thumbnail
757 * @cfg {String} src image source
758 * @cfg {String} alt image alternative text
762 * @param {Object} config The config object
765 Roo.bootstrap.Img = function(config){
766 Roo.bootstrap.Img.superclass.constructor.call(this, config);
769 Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, {
775 getAutoCreate : function(){
779 cls: 'img-responsive',
783 cfg.html = this.html || cfg.html;
785 cfg.src = this.src || cfg.src;
787 if (['rounded','circle','thumbnail'].indexOf(this.border)>-1) {
788 cfg.cls += ' img-' + this.border;
808 * @class Roo.bootstrap.Input
809 * @extends Roo.bootstrap.Component
810 * Bootstrap Input class
811 * @cfg {Boolean} disabled is it disabled
812 * @cfg {String} fieldLabel - the label associated
813 * @cfg {String} inputType button | checkbox | email | file | hidden | image | number | password | radio | range | reset | search | submit | text
814 * @cfg {String} name name of the input
815 * @cfg {boolean} disabled is it disabled
816 * @cfg {string} fieldLabel - the label associated
817 * @cfg {string} inputType - input / file submit ...
818 * @cfg {string} placeholder - placeholder to put in text.
819 * @cfg {string} before - input group add on before
820 * @cfg {string} after - input group add on after
825 * @param {Object} config The config object
828 Roo.bootstrap.Input = function(config){
829 Roo.bootstrap.Input.superclass.constructor.call(this, config);
833 Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component, {
843 getAutoCreate : function(){
845 var parent = this.parent();
847 var align = parent.labelAlign;
852 cls: 'form-group' //input-group
858 type : this.inputType,
859 cls : 'form-control',
860 placeholder : this.placeholder || ''
867 var inputblock = input;
869 if (this.before || this.after) {
878 cls : 'input-group-addon',
882 inputblock.cn.push(input);
886 cls : 'input-group-addon',
894 Roo.log(this.fieldLabel.length);
896 if (align ==='left' && this.fieldLabel.length) {
897 Roo.log("left and has label");
903 cls : 'col-sm-2 control-label',
904 html : this.fieldLabel
915 } else if ( this.fieldLabel.length) {
921 //cls : 'input-group-addon',
922 html : this.fieldLabel
932 Roo.log(" no label && no align");
951 setDisabled : function(v)
953 var i = this.el.select('input',true).dom;
955 i.removeAttribute('disabled');
959 i.setAttribute('disabled','true');
972 * @class Roo.bootstrap.Header
973 * @extends Roo.bootstrap.Component
974 * Bootstrap Header class
975 * @cfg {String} html content of header
976 * @cfg {Number} level (1|2|3|4|5|6) default 1
979 * Create a new Header
980 * @param {Object} config The config object
984 Roo.bootstrap.Header = function(config){
985 Roo.bootstrap.Header.superclass.constructor.call(this, config);
988 Roo.extend(Roo.bootstrap.Header, Roo.bootstrap.Component, {
996 getAutoCreate : function(){
999 tag: 'h' + (1 *this.level),
1000 html: this.html || 'fill in html'
1018 * @class Roo.bootstrap.Menu
1019 * @extends Roo.bootstrap.Component
1020 * Bootstrap Menu class - container for MenuItems
1021 * @cfg {String} type type of menu
1025 * @param {Object} config The config object
1029 Roo.bootstrap.Menu = function(config){
1030 Roo.bootstrap.Menu.superclass.constructor.call(this, config);
1033 Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component, {
1041 getChildContainer : function() {
1045 getAutoCreate : function(){
1047 //if (['right'].indexOf(this.align)!==-1) {
1048 // cfg.cn[1].cls += ' pull-right'
1052 cls : 'dropdown-menu'
1056 if (this.type==='submenu') {
1057 cfg.cls='submenu active'
1062 initEvents : function() {
1063 // Roo.log("ADD event");
1064 // Roo.log(this.triggerEl.dom);
1065 this.triggerEl.on('click', this.toggle, this);
1066 this.triggerEl.addClass('dropdown-toggle');
1069 toggle : function(e)
1071 //Roo.log(e.getTarget());
1072 // Roo.log(this.triggerEl.dom);
1073 if (Roo.get(e.getTarget()).findParent('.dropdown-menu')) {
1076 var isActive = this.triggerEl.hasClass('open');
1077 // if disabled.. ingore
1079 //if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
1080 // if mobile we use a backdrop because click events don't delegate
1081 // $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
1084 //var relatedTarget = { relatedTarget: this }
1085 //$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
1087 //if (e.isDefaultPrevented()) return;
1089 this.triggerEl[isActive ? 'removeClass' : 'addClass']('open');
1091 // .trigger('shown.bs.dropdown', relatedTarget)
1093 this.triggerEl.focus();
1099 clearMenus : function()
1101 //$(backdrop).remove()
1102 Roo.select('.dropdown-toggle',true).each(function(aa) {
1103 if (!aa.hasClass('open')) {
1107 aa.removeClass('open');
1108 //var parent = getParent($(this))
1109 //var relatedTarget = { relatedTarget: this }
1111 //$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
1112 //if (e.isDefaultPrevented()) return
1113 //$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
1131 * @class Roo.bootstrap.MenuItem
1132 * @extends Roo.bootstrap.Component
1133 * Bootstrap MenuItem class
1134 * @cfg {String} html the menu label
1135 * @cfg {String} href the link
1139 * Create a new MenuItem
1140 * @param {Object} config The config object
1144 Roo.bootstrap.MenuItem = function(config){
1145 Roo.bootstrap.MenuItem.superclass.constructor.call(this, config);
1148 Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
1153 getAutoCreate : function(){
1165 cfg.cn[0].href = this.href || cfg.cn[0].href ;
1166 cfg.cn[0].html = this.html || cfg.cn[0].html ;
1183 * @class Roo.bootstrap.MenuSeparator
1184 * @extends Roo.bootstrap.Component
1185 * Bootstrap MenuSeparator class
1188 * Create a new MenuItem
1189 * @param {Object} config The config object
1193 Roo.bootstrap.MenuSeparator = function(config){
1194 Roo.bootstrap.MenuSeparator.superclass.constructor.call(this, config);
1197 Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component, {
1199 getAutoCreate : function(){
1214 <div class="modal fade">
1215 <div class="modal-dialog">
1216 <div class="modal-content">
1217 <div class="modal-header">
1218 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
1219 <h4 class="modal-title">Modal title</h4>
1221 <div class="modal-body">
1222 <p>One fine body…</p>
1224 <div class="modal-footer">
1225 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
1226 <button type="button" class="btn btn-primary">Save changes</button>
1228 </div><!-- /.modal-content -->
1229 </div><!-- /.modal-dialog -->
1230 </div><!-- /.modal -->
1240 * @class Roo.bootstrap.Modal
1241 * @extends Roo.bootstrap.Component
1242 * Bootstrap Modal class
1243 * @cfg {String} title Title of dialog
1244 * @cfg {Array} buttons Array of buttons
1247 * Create a new Modal Dialog
1248 * @param {Object} config The config object
1251 Roo.bootstrap.Modal = function(config){
1252 Roo.bootstrap.Modal.superclass.constructor.call(this, config);
1255 Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, {
1257 title : 'test dialog',
1261 onRender : function(ct, position)
1263 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
1265 var cfg = Roo.apply({}, this.getAutoCreate());
1268 // cfg.name = typeof(this.name) == 'undefined' ? this.id : this.name;
1270 //if (!cfg.name.length) {
1274 cfg.cls += ' ' + this.cls;
1277 cfg.style = this.style;
1279 this.el = Roo.get(document.body).createChild(cfg, position);
1281 //var type = this.el.dom.type;
1283 if(this.tabIndex !== undefined){
1284 this.el.dom.setAttribute('tabIndex', this.tabIndex);
1287 //this.el.addClass([this.fieldClass, this.cls]);
1290 getAutoCreate : function(){
1296 cls: "modal-dialog",
1299 cls : "modal-content",
1302 cls : 'modal-header',
1311 cls : 'modal-title',
1322 cls : 'modal-footer'
1327 cls : 'btn btn-default',
1332 cls : 'btn btn-primary',
1353 getChildContainer : function() {
1355 return this.el.select('.modal-body',true).first();
1358 getButtonContainer : function() {
1359 return this.el.select('.modal-footer',true).first();
1362 initEvents : function()
1364 this.el.select('.modal-header .close').on('click', this.hide, this);
1367 this.el.addClass('on');
1368 this.el.removeClass('fade');
1369 this.el.setStyle('display', 'block');
1372 this.el.removeClass('on');
1373 this.el.addClass('fade');
1374 this.el.setStyle('display', 'none');
1386 * @class Roo.bootstrap.Navbar
1387 * @extends Roo.bootstrap.Component
1388 * Bootstrap Navbar class
1389 * @cfg {Boolean} sidebar has side bar
1390 * @cfg {Boolean} bar is a bar?
1391 * @cfg {String} position (fixed-top|fixed-bottom|static-top) position
1392 * @cfg {String} brand what is brand
1393 * @cfg {Boolean} inverse is inverted color
1394 * @cfg {String} type (nav | pills | tabs)
1395 * @cfg {Boolean} arrangement stacked | justified
1396 * @cfg {String} align (left | right) alignment
1400 * Create a new Navbar
1401 * @param {Object} config The config object
1405 Roo.bootstrap.Navbar = function(config){
1406 Roo.bootstrap.Navbar.superclass.constructor.call(this, config);
1409 Roo.extend(Roo.bootstrap.Navbar, Roo.bootstrap.Component, {
1421 getAutoCreate : function(){
1426 if (this.sidebar === true) {
1434 if (this.bar === true) {
1442 cls: 'navbar-header',
1447 cls: 'navbar-toggle',
1448 'data-toggle': 'collapse',
1453 html: 'Toggle navigation'
1473 cls: 'collapse navbar-collapse'
1478 cfg.cls += this.inverse ? ' navbar-inverse' : ' navbar-default';
1480 if (['fixed-top','fixed-bottom','static-top'].indexOf(this.position)>-1) {
1481 cfg.cls += ' navbar-' + this.position;
1482 cfg.tag = this.position == 'fixed-bottom' ? 'footer' : 'header';
1485 if (this.brand !== '') {
1489 cls: 'navbar-brand',
1498 } else if (this.bar === false) {
1501 Roo.log('Property \'bar\' in of Navbar must be either true or false')
1511 if (['tabs','pills'].indexOf(this.type)!==-1) {
1512 cfg.cn[0].cls += ' nav-' + this.type
1514 if (this.type!=='nav') {
1515 Roo.log('nav type must be nav/tabs/pills')
1517 cfg.cn[0].cls += ' navbar-nav'
1520 if (['stacked','justified'].indexOf(this.arrangement)!==-1) {
1521 cfg.cn[0].cls += ' nav-' + this.arrangement;
1524 if (this.align === 'right') {
1525 cfg.cn[0].cls += ' navbar-right';
1528 cfg.cls += ' navbar-inverse';
1536 getChildContainer : function() {
1537 if (this.bar === true) {
1538 return this.el.select('.collapse',true).first();
1556 * @class Roo.bootstrap.NavGroup
1557 * @extends Roo.bootstrap.Component
1558 * Bootstrap NavGroup class
1559 * @cfg {String} align left | right
1560 * @cfg {Boolean} inverse false | true
1563 * Create a new nav group
1564 * @param {Object} config The config object
1567 Roo.bootstrap.NavGroup = function(config){
1568 Roo.bootstrap.NavGroup.superclass.constructor.call(this, config);
1571 Roo.extend(Roo.bootstrap.NavGroup, Roo.bootstrap.Component, {
1577 getAutoCreate : function(){
1578 var cfg = Roo.apply({}, Roo.bootstrap.NavGroup.superclass.getAutoCreate.call(this));
1582 cls: 'nav navbar-nav'
1585 if (this.parent().sidebar === true) {
1588 cls: 'dashboard-menu'
1594 if (this.form === true) {
1600 if (this.align === 'right') {
1601 cfg.cls += ' navbar-right';
1603 cfg.cls += ' navbar-left';
1608 if (this.align === 'right') {
1609 cfg.cls += ' navbar-right';
1613 cfg.cls += ' navbar-inverse';
1632 * @class Roo.bootstrap.Navbar.Button
1633 * @extends Roo.bootstrap.Component
1634 * Bootstrap Navbar.Button class
1635 * @cfg {String} href link to
1636 * @cfg {String} html content of button
1639 * Create a new Navbar Button
1640 * @param {Object} config The config object
1644 Roo.bootstrap.Navbar.Button = function(config){
1645 Roo.bootstrap.Navbar.Button.superclass.constructor.call(this, config);
1648 Roo.extend(Roo.bootstrap.Navbar.Button, Roo.bootstrap.Component, {
1659 getAutoCreate : function(){
1669 html : this.html || ''
1693 * @class Roo.bootstrap.Navbar.Item
1694 * @extends Roo.bootstrap.Component
1695 * Bootstrap Navbar.Button class
1696 * @cfg {String} href link to
1697 * @cfg {String} html content of button
1698 * @cfg {String} badge text inside badge
1699 * @cfg {String} glyphicon name of glyphicon
1702 * Create a new Navbar Button
1703 * @param {Object} config The config object
1705 Roo.bootstrap.Navbar.Item = function(config){
1706 Roo.bootstrap.Navbar.Item.superclass.constructor.call(this, config);
1709 Roo.extend(Roo.bootstrap.Navbar.Item, Roo.bootstrap.Component, {
1717 getAutoCreate : function(){
1719 var cfg = Roo.apply({}, Roo.bootstrap.Navbar.Item.superclass.getAutoCreate.call(this));
1721 if (this.parent().parent().sidebar === true) {
1734 cfg.cn[0].html = this.html;
1738 this.cls += ' active';
1742 cfg.cn[0].cls += ' dropdown-toggle';
1743 cfg.cn[0].html = (cfg.cn[0].html || this.html) + '<span class="glyphicon glyphicon-chevron-down"></span>';
1747 cfg.cn[0].tag = 'a',
1748 cfg.cn[0].href = this.href;
1751 if (this.glyphicon) {
1752 cfg.cn[0].html = '<i class="glyphicon glyphicon-'+this.glyphicon+'"></i><span>' + cfg.cn[0].html || this.html + '</span>'
1768 if (this.glyphicon) {
1769 if(cfg.html){cfg.html = ' ' + this.html};
1773 cls: 'glyphicon glyphicon-' + this.glyphicon
1778 cfg.cn[0].html = this.html || cfg.cn[0].html ;
1782 cfg.cn[0].html += " <span class='caret'></span>";
1783 //}else if (!this.href) {
1784 // cfg.cn[0].tag='p';
1785 // cfg.cn[0].cls='navbar-text';
1788 cfg.cn[0].href=this.href||'#';
1789 cfg.cn[0].html=this.html;
1792 if (this.badge !== '') {
1795 cfg.cn[0].html + ' ',
1808 initEvents: function() {
1809 // Roo.log('init events?');
1810 // Roo.log(this.el.dom);
1811 this.el.select('a',true).on('click',
1813 this.fireEvent('click', this);
1830 * @class Roo.bootstrap.Row
1831 * @extends Roo.bootstrap.Component
1832 * Bootstrap Row class (contains columns...)
1836 * @param {Object} config The config object
1839 Roo.bootstrap.Row = function(config){
1840 Roo.bootstrap.Row.superclass.constructor.call(this, config);
1843 Roo.extend(Roo.bootstrap.Row, Roo.bootstrap.Component, {
1862 * @class Roo.bootstrap.Element
1863 * @extends Roo.bootstrap.Component
1864 * Bootstrap Element class
1865 * @cfg {String} html contents of the element
1866 * @cfg {String} tag tag of the element
1867 * @cfg {String} cls class of the element
1870 * Create a new Element
1871 * @param {Object} config The config object
1874 Roo.bootstrap.Element = function(config){
1875 Roo.bootstrap.Element.superclass.constructor.call(this, config);
1878 Roo.extend(Roo.bootstrap.Element, Roo.bootstrap.Component, {
1886 getAutoCreate : function(){
1887 var cfg = Roo.apply({}, Roo.bootstrap.Element.superclass.getAutoCreate.call(this));
1910 * @class Roo.bootstrap.Pagination
1911 * @extends Roo.bootstrap.Component
1912 * Bootstrap Pagination class
1913 * @cfg {String} size xs | sm | md | lg
1914 * @cfg {Boolean} inverse false | true
1915 * @cfg {Number} from pagination starting number
1916 * @cfg {Number} to pagination ending number
1917 * @cfg {String} align empty or left | right
1918 * @cfg {Number} active active page number
1921 * Create a new Pagination
1922 * @param {Object} config The config object
1925 Roo.bootstrap.Pagination = function(config){
1926 Roo.bootstrap.Pagination.superclass.constructor.call(this, config);
1929 Roo.extend(Roo.bootstrap.Pagination, Roo.bootstrap.Component, {
1939 getAutoCreate : function(){
1946 cfg.cls += ' inverse';
1964 var from=this.from>0?this.from:1;
1965 var to=this.to-from<=10?this.to:from+10;
1966 var active=this.active>=from&&this.active<=to?this.active:null;
1967 for (var i=from;i<=to;i++) {
1971 cls: active===i?'active':'',
2012 * @class Roo.bootstrap.Slider
2013 * @extends Roo.bootstrap.Component
2014 * Bootstrap Slider class
2017 * Create a new Slider
2018 * @param {Object} config The config object
2021 Roo.bootstrap.Slider = function(config){
2022 Roo.bootstrap.Slider.superclass.constructor.call(this, config);
2025 Roo.extend(Roo.bootstrap.Slider, Roo.bootstrap.Component, {
2027 getAutoCreate : function(){
2031 cls: 'slider slider-sample1 vertical-handler ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all',
2035 cls: 'ui-slider-handle ui-state-default ui-corner-all'
2053 * @class Roo.bootstrap.Table
2054 * @extends Roo.bootstrap.Component
2055 * Bootstrap Table class
2058 * Create a new Table
2059 * @param {Object} config The config object
2062 Roo.bootstrap.Table = function(config){
2063 Roo.bootstrap.Table.superclass.constructor.call(this, config);
2066 Roo.extend(Roo.bootstrap.Table, Roo.bootstrap.Component, {
2071 getAutoCreate : function(){
2072 var cfg = Roo.apply({}, Roo.bootstrap.Table.superclass.getAutoCreate.call(this));
2104 * @class Roo.bootstrap.TableCell
2105 * @extends Roo.bootstrap.Component
2106 * Bootstrap TableCell class
2109 * Create a new TableCell
2110 * @param {Object} config The config object
2113 Roo.bootstrap.TableCell = function(config){
2114 Roo.bootstrap.TableCell.superclass.constructor.call(this, config);
2117 Roo.extend(Roo.bootstrap.TableCell, Roo.bootstrap.Component, {
2119 getAutoCreate : function(){
2120 var cfg = Roo.apply({}, Roo.bootstrap.TableCell.superclass.getAutoCreate.call(this));
2147 * @class Roo.bootstrap.TableRow
2148 * @extends Roo.bootstrap.Component
2149 * Bootstrap TableRow class
2152 * Create a new TableRow
2153 * @param {Object} config The config object
2156 Roo.bootstrap.TableRow = function(config){
2157 Roo.bootstrap.TableRow.superclass.constructor.call(this, config);
2160 Roo.extend(Roo.bootstrap.TableRow, Roo.bootstrap.Component, {
2162 getAutoCreate : function(){
2163 var cfg = Roo.apply({}, Roo.bootstrap.TableRow.superclass.getAutoCreate.call(this));