This commit is contained in:
yumoqing 2024-03-06 16:36:20 +08:00
parent 5f957fb1d2
commit 15e64a16f9
3 changed files with 21 additions and 11 deletions

View File

@ -33,14 +33,16 @@ bricks.TabPanel = class extends bricks.Layout {
this.content_container = new bricks.VFiller({}); this.content_container = new bricks.VFiller({});
if (this.opts.tab_pos == 'top' || this.opts.tab_pos == 'bottom'){ if (this.opts.tab_pos == 'top' || this.opts.tab_pos == 'bottom'){
this.set_css('vbox'); this.set_css('vbox');
var height = this.opts.tab_wide || 'auto'; this.tab_container = new bricks.VBox({
this.tab_container = new bricks.VBox({height:height}); height:'auto',
this.tab_container.dom_element.style.width = this.opts.tab_long || '100%'; width:'auto'
});
} else { } else {
this.set_css('hbox'); this.set_css('hbox');
var width= this.opts.tab_wide || 'auto'; this.tab_container = new bricks.VBox({
this.tab_container = new bricks.VBox({width:width}); width:'auto',
this.tab_container.dom_element.style.height = this.opts.tab_long || '100%'; height:'auto'
});
} }
if (this.opts.tab_pos == 'top' || this.opts.tab_pos == 'left'){ if (this.opts.tab_pos == 'top' || this.opts.tab_pos == 'left'){
this.add_widget(this.tab_container); this.add_widget(this.tab_container);

View File

@ -2,7 +2,15 @@ var bricks = window.bricks || {};
bricks.isMobile = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); bricks.isMobile = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
bricks.is_mobile = function(){ bricks.is_mobile = function(){
return typeof screen.orientation !== 'undefined'; var userAgent = navigator.userAgent;
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent)) {
return true;
}
if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) {
return true;
}
} }
class _TypeIcons { class _TypeIcons {

View File

@ -8,22 +8,22 @@
"tools":[ "tools":[
{ {
"name":"c", "name":"c",
"Label":"C", "label":"C",
"icon":null "icon":null
}, },
{ {
"name":"javascript", "name":"javascript",
"Label":"JavaScript", "label":"JavaScript",
"icon":null "icon":null
}, },
{ {
"name":"php", "name":"php",
"Label":"PHP", "label":"PHP",
"icon":null "icon":null
}, },
{ {
"name":"python", "name":"python",
"Label":"Python", "label":"Python",
"icon":null "icon":null
}, },
] ]