* @class Roo.bootstrap.Column
* @extends Roo.bootstrap.Component
* Bootstrap Column class
- * @cfg {Number} xs colspan out of 12 for mobile-sized screens
- * @cfg {Number} sm colspan out of 12 for tablet-sized screens
- * @cfg {Number} md colspan out of 12 for computer-sized screens
- * @cfg {Number} lg colspan out of 12 for large computer-sized screens
+ * @cfg {Number} xs colspan out of 12 for mobile-sized screens or 0 for hidden
+ * @cfg {Number} sm colspan out of 12 for tablet-sized screens or 0 for hidden
+ * @cfg {Number} md colspan out of 12 for computer-sized screens or 0 for hidden
+ * @cfg {Number} lg colspan out of 12 for large computer-sized screens or 0 for hidden
* @cfg {String} html content of column.
*
* @constructor
Roo.extend(Roo.bootstrap.Column, Roo.bootstrap.Component, {
- xs: null,
- sm: null,
- md: null,
- lg: null,
+ xs: false,
+ sm: false,
+ md: false,
+ lg: false,
html: '',
offset: 0,
var settings=this;
['xs','sm','md','lg'].map(function(size){
- if (settings[size]) {
+ if (settings[size] !== false) {
+ if (!settings[size]) { // 0 = hidden
+ cfg.cls += ' hidden-' + size;
+ return;
+ }
cfg.cls += ' col-' + size + '-' + settings[size];
}
});
* @cfg {String} position (fixed-top|fixed-bottom|static-top) position
* @cfg {String} brand_href href of the brand
* @cfg {Boolean} srButton generate the sr-only button (true | false) default true
+ * @cfg {Boolean} autohide a top nav bar header that hides on scroll.
*
* @constructor
* Create a new Sidebar
brand: '',
brand_href: false,
srButton : true,
-
+ autohide : false,
getAutoCreate : function(){
return cfg;
- }
-
+ },
+ initEvents : function()
+ {
+ Roo.bootstrap.NavHeaderbar.superclass.initEvents.call(this);
+
+ if (this.autohide) {
+
+ var prevScroll = 0;
+ var ft = this.el;
+
+ Roo.get(document).on('scroll',function(e) {
+ var ns = Roo.get(document).getScroll().top;
+ var os = prevScroll;
+ prevScroll = ns;
+
+ if(ns > os){
+ ft.removeClass('slideDown');
+ ft.addClass('slideUp');
+ return;
+ }
+ ft.removeClass('slideUp');
+ ft.addClass('slideDown');
+
+
+ },this);
+ }
+ }
+
+
});
]
};
- if(!this.multiple){
+ if(!this.multiple && this.showToggleBtn){
combobox.cn.push({
tag :'span',
cls : 'input-group-addon btn dropdown-toggle',
cls: 'typeahead typeahead-long dropdown-menu',
style: 'display:none'
});
+
+ this.list.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';;
+
},
// private
* @cfg {Boolean} autoFocus (true|false) auto focus the first item, default true
* @cfg {Boolean} tickable ComboBox with tickable selections (true|false), default false
* @cfg {Boolean} triggerList trigger show the list or not (true|false) default true
+ * @cfg {Boolean} show toggle button or not (true|false) default true
* @cfg {String} btnPosition set the position of the trigger button (left | right) default right
* @constructor
* Create a new ComboBox.
tickable : false,
btnPosition : 'right',
triggerList : true,
+ showToggleBtn : true,
// element that contains real text value.. (when hidden is used..)
getAutoCreate : function()
this.store = Roo.factory(this.store, Roo.data);
if(this.tickable){
- this.initTickableEvnets();
+ this.initTickableEvents();
return;
}
}
},
- initTickableEvnets: function()
+ initTickableEvents: function()
{
this.createList();
setFromData : function(o){
if(this.multiple){
+ if(typeof o.display_name !== 'string'){
+ for(var i=0;i<o.display_name.length;i++){
+ this.addItem({'id':o.id[i],'display_name':o.display_name[i]});
+ }
+ return;
+ }
this.addItem(o);
return;
}
this.doc = iframe.contentWindow.document;
this.win = iframe.contentWindow;
} else {
- if (!Roo.get(this.frameId)) {
+// if (!Roo.get(this.frameId)) {
+// return;
+// }
+// this.doc = (iframe.contentDocument || Roo.get(this.frameId).dom.document);
+// this.win = Roo.get(this.frameId).dom.contentWindow;
+
+ if (!Roo.get(this.frameId) && !iframe.contentDocument) {
return;
}
+
this.doc = (iframe.contentDocument || Roo.get(this.frameId).dom.document);
- this.win = Roo.get(this.frameId).dom.contentWindow;
+ this.win = (iframe.contentWindow || Roo.get(this.frameId).dom.contentWindow);
}
},
return;
}
this.title = str;
- this.tab.select('a'.true).first().dom.innerHTML = str;
+ this.tab.select('a', true).first().dom.innerHTML = str;
}