mofron-comp-appbase
Advanced tools
Comparing version 0.4.3 to 0.4.4
29
index.js
@@ -122,3 +122,4 @@ /** | ||
/* getter */ | ||
return this.bgwrap().child(); | ||
let ret = this.bgwrap().child(); | ||
return (0 === ret.length) ? null : ret[0]; | ||
} | ||
@@ -175,4 +176,30 @@ /* setter */ | ||
} | ||
/** | ||
* background base color setter/getter | ||
* | ||
* @param p1 (string) color value (css) | ||
* @param p1 (Array) [red(0-255), green(0-255), blue(0-255)] | ||
* @param p1 (undefined) call as getter | ||
* @return (string) color value (css) | ||
*/ | ||
baseColor (prm) { | ||
try { | ||
let bg = this.background(); | ||
if (undefined === prm) { | ||
/* getter */ | ||
return (null !== bg) ? bg.baseColor() : null; | ||
} | ||
/* setter */ | ||
if (null === bg) { | ||
this.background(new mf.Component()); | ||
} | ||
this.background().execOption({ baseColor : prm }); | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
} | ||
module.exports = mofron.comp.AppBase; | ||
/* end of file */ |
{ | ||
"name": "mofron-comp-appbase", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "application base component for mofron", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
8379
190