mofron-comp-header
Advanced tools
Comparing version 0.9.3 to 0.10.0
57
index.js
@@ -26,15 +26,19 @@ /** | ||
/** | ||
* initialize dom contents | ||
* | ||
* @note private method | ||
*/ | ||
initDomConts () { | ||
try { | ||
super.initDomConts(); | ||
let conts = new mf.Component({}); | ||
this.addChild(conts); | ||
this.target(conts.target()); | ||
this.addChild(new mf.Component({})); | ||
this.target(this.child()[0].target()); | ||
this.layout([ new Horizon() ]); | ||
this.effect([ new Border({ type : 'bottom' }) ]); | ||
this.layout(new Horizon()); | ||
this.effect(new Border({ type : 'bottom' })); | ||
this.size('100%', '0.5rem'); | ||
this.bind(true); | ||
this.mainColor(new mf.Color(211,211,211)); | ||
this.mainColor([211,211,211]); | ||
} catch (e) { | ||
@@ -47,11 +51,16 @@ console.error(e.stack); | ||
/** | ||
* set/get header height | ||
* | ||
* setter/getter for header height | ||
* | ||
* @param val (string) css value of height | ||
* @param val (undefined) call as getter | ||
* @return (string) height value | ||
* @param (null) not set yet | ||
*/ | ||
height (prm) { | ||
height (val) { | ||
try { | ||
let ret = super.height(prm); | ||
if (undefined === ret) { | ||
/* setter */ | ||
this.adom().child()[0].style({ 'height' : prm }); | ||
let ret = super.height(val); | ||
if (undefined !== val) { | ||
this.getDomChild()[0].style({ | ||
height : val | ||
}); | ||
} | ||
@@ -65,2 +74,11 @@ return ret; | ||
/** | ||
* setter/getter for bind header | ||
* binding displays header even if user scrolls. | ||
* | ||
* @param flg (boolean) binding status | ||
* @param flg (undefined) call as getter | ||
* @return (true) binding is enabled (default) | ||
* @return (false) binding is disabled | ||
*/ | ||
bind (flg) { | ||
@@ -94,7 +112,10 @@ try { | ||
mainColor (prm) { | ||
try { | ||
let bdr = this.getConfig('effect', 'Border'); | ||
return (null === bdr) ? null : bdr.color(prm); | ||
} catch (e) { | ||
/** | ||
* setter/getter for bottom border color | ||
* | ||
* @param clr (string) | ||
* | ||
*/ | ||
mainColor (clr) { | ||
try { return this.effect('Border').color(clr); } catch (e) { | ||
console.error(e.stack); | ||
@@ -101,0 +122,0 @@ throw e; |
{ | ||
"name": "mofron-comp-header", | ||
"version": "0.9.3", | ||
"version": "0.10.0", | ||
"description": "header component for mofron", | ||
@@ -21,3 +21,3 @@ "main": "index.js", | ||
"author": "simparts", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"license": "MIT", | ||
"bugs": { | ||
@@ -24,0 +24,0 @@ "url": "https://github.com/mofron/mofron-comp-header/issues" |
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
5358
0
116