+ Настройка тёмного цвета

This commit is contained in:
2020-07-29 07:37:46 +06:00
parent 868021bf79
commit 28379fff1e
10 changed files with 180 additions and 147 deletions

View File

@ -1,7 +1,13 @@
class tcTab
{
constructor(caption){
constructor(config){
this.bColor="";
if(typeof config.float == 'undefined'){ config.float='left'; }
this.id=0;
this.par=null;
this.sel=false;
@ -10,12 +16,12 @@ class tcTab
//Сам таб на который нажимаем (ушко)
this.div=document.createElement('div')
this.div.style.cssText='position: relative; top: 1px; cursor: pointer; float: left; border: 1px solid #b3b3b3; border-radius: 5px 5px 0px 0px; padding: 1px; padding-right: 4px; padding-left: 4px; margin-left: 2px; margin-right: 2px;'
this.div.style.background = '#dfdfdf';
this.div.innerHTML=caption;
this.div.style.cssText='position: relative; top: 1px; cursor: pointer; float: '+config.float+'; border: 1px solid #b3b3b3; border-radius: 5px 5px 0px 0px; padding: 1px; padding-right: 4px; padding-left: 4px; margin-left: 2px; margin-right: 2px;'
this.div.style.background = g_backColor1;
this.div.innerHTML=config.caption;
this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#f0f0f0';}}(this);
this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#dfdfdf' }}(this);
this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_rowColor1; }}(this);
this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_backColor1; }}(this);
this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this)
}
@ -44,12 +50,12 @@ class tcTab
setSel()
{
for(let i=0;i<this.par.tbs.length;i++)
{ this.par.tbs[i].div.style.background = '#dfdfdf'
{ this.par.tbs[i].div.style.background = g_backColor1;
this.par.tbs[i].div.style.borderBottom = "1px solid #b3b3b3"
this.par.tbs[i].sel=false
this.par.tbs[i].con.style.display='none'
}
this.div.style.background = '#ffffff';
this.div.style.background = g_rowColor2;
this.div.style.borderBottom = '1px solid #ffffff'
//this.con.style.display='inline'
this.con.style.display='block';
@ -74,7 +80,7 @@ class tcTabs
tr.style.cssText='display: table-row; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
this.btt=document.createElement('div');
this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;background-color: '+g_backColor2+';color:'+g_textColor1+';';
tr.appendChild(this.btt);
this.wra.appendChild(tr);
@ -91,9 +97,9 @@ class tcTabs
this.bd.appendChild(this.wra);
}
addTab(caption)
addTab(config)
{
var tab=new tcTab(caption)
var tab=new tcTab(config)
tab.par=this
this.btt.appendChild(tab.div);