name: false,
target: false,
+ pressed : false,
+
+
getAutoCreate : function(){
var cfg = {
if (this.theme==='default') {
cfg.cls = 'btn roo-button';
- if (this.parentType != 'Navbar') {
- this.weight = this.weight.length ? this.weight : 'default';
- }
+ //if (this.parentType != 'Navbar') {
+ this.weight = this.weight.length ? this.weight : 'default';
+ //}
if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
cfg.cls += ' btn-' + this.weight;
cfg.cls += ' active';
}
+ if (this.disabled) {
+ cfg.disabled = 'disabled';
+ }
+
+ if (this.items) {
+ Roo.log('changing to ul' );
+ cfg.tag = 'ul';
+ this.glyphicon = 'caret';
+ }
+
cfg.cls += this.size.length ? (' btn-' + this.size) : '';
//gsRoo.log(this.parentType);
- if (this.parentType === 'Navbar') {
+ if (this.parentType === 'Navbar' && !this.parent().bar) {
+ Roo.log('changing to li?');
+
cfg.tag = 'li';
cfg.cls = '';
delete cfg.html;
- }
- else if (this.menu) {
- cfg.cls += ' dropdown';
- cfg.html = this.html + ' <span class="caret"></span>';
}
- if (this.disabled) {
- cfg.disabled = 'disabled';
- }
- //????
- if (this.items) {
- Roo.log('changing to ul' );
- cfg.tag = 'ul';
- this.glyphicon = 'caret';
- }
+ cfg.cls += this.parentType === 'Navbar' ? ' navbar-btn' : '';
if (this.glyphicon) {
cfg.html = ' ' + cfg.html;
cfg.html='';
}
+ if (this.menu) {
+ cfg.cls += ' dropdown';
+ cfg.html = typeof(cfg.html) != 'undefined' ? cfg.html + ' <span class="caret"></span>' : '<span class="caret"></span>';
+ }
+
if (cfg.tag !== 'a' && this.href !== '') {
throw "Tag must be a to set href.";
} else if (this.href.length > 0) {