mofron-comp-header
Advanced tools
Comparing version 0.8.5 to 0.8.6
72
index.js
@@ -18,2 +18,3 @@ /** | ||
this.name('Header'); | ||
this.prmMap('addChild'); | ||
this.prmOpt(po); | ||
@@ -26,12 +27,13 @@ } catch (e) { | ||
initDomConts (prm) { | ||
initDomConts () { | ||
try { | ||
/* set header dom contents */ | ||
var hdr = new mf.Dom({ | ||
let hdr = new mf.Dom({ | ||
tag : 'div', | ||
component : this, | ||
style : { 'border-bottom' : 'solid 1px lightgray', | ||
'float' : 'left' } | ||
style : { 'border-bottom-style' : 'solid', | ||
'border-bottom-width' : '1px', | ||
'float' : 'left' } | ||
}); | ||
var pad = new mf.Dom({ | ||
let pad = new mf.Dom({ | ||
tag : 'div', | ||
@@ -47,5 +49,6 @@ component : this, | ||
/* set default size */ | ||
/* set default config */ | ||
this.size('100%', 50); | ||
this.bind(true); | ||
this.mainColor(new mf.Color(211,211,211)); | ||
@@ -55,6 +58,2 @@ /* child comp is added at horizon layout */ | ||
/* set child component */ | ||
if (undefined !== prm) { | ||
this.addChild(prm); | ||
} | ||
} catch (e) { | ||
@@ -66,14 +65,2 @@ console.error(e.stack); | ||
themeConts (thm) { | ||
try { | ||
if ( (null !== thm.color(0)) && | ||
(null === this.color()) ) { | ||
this.color(thm.color(0)); | ||
} | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
/** | ||
@@ -99,24 +86,2 @@ * set/get header height | ||
/** | ||
* header background color setter / getter | ||
* | ||
* clr : (object) color | ||
*/ | ||
color (clr) { | ||
try { | ||
if (undefined === clr) { | ||
/* getter */ | ||
return mf.func.getColor(this.style('background')); | ||
} | ||
/* setter */ | ||
if (false === mf.func.isObject(clr, 'Color')) { | ||
throw new Error('invalid parameter'); | ||
} | ||
this.style({ 'background' : clr.getStyle() }); | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
bind (flg) { | ||
@@ -149,4 +114,23 @@ try { | ||
} | ||
mainColor (prm) { | ||
try { | ||
if (undefined === prm) { | ||
/* getter */ | ||
return mf.func.getColor(this.style('border-bottom-color')); | ||
} | ||
/* setter */ | ||
if (true !== mf.func.isObject(prm, 'Color')) { | ||
throw new Error('invalid parameter'); | ||
} | ||
this.style({ | ||
'border-bottom-color' : prm.getStyle() | ||
}); | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
} | ||
module.exports = mofron.comp.Header; | ||
/* end of file */ |
{ | ||
"name": "mofron-comp-header", | ||
"version": "0.8.5", | ||
"version": "0.8.6", | ||
"description": "header component for mofron", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5732
119