mofron-comp-appbase
Advanced tools
Comparing version 0.3.1 to 0.4.0
56
index.js
@@ -21,3 +21,3 @@ /** | ||
this.name('AppBase'); | ||
this.prmMap('title', 'addChild'); | ||
this.prmMap('title', 'child'); | ||
this.prmOpt(po, p2); | ||
@@ -45,3 +45,5 @@ } catch (e) { | ||
/* contents */ | ||
let conts = new mf.Component({width : '100%'}); | ||
let conts = new mf.Component({ | ||
width : '100%' | ||
}); | ||
this.addChild(conts); | ||
@@ -55,6 +57,14 @@ this.target(conts.target()); | ||
} | ||
title (prm) { | ||
try { | ||
return this.header().title(prm); | ||
if (undefined === prm) { | ||
/* getter */ | ||
return this.header().title(); | ||
} | ||
/* setter */ | ||
this.header().execOption({ | ||
title : prm | ||
}); | ||
} catch (e) { | ||
@@ -107,6 +117,8 @@ console.error(e.stack); | ||
} | ||
prm.effect([ | ||
new Backgd(), | ||
new Synwin(false, true, null, 0 - this.header().height()) | ||
]); | ||
prm.execOption({ | ||
effect : [ | ||
new Backgd(), | ||
new Synwin(false, true) | ||
] | ||
}); | ||
@@ -118,3 +130,3 @@ this.switchTgt( | ||
if (null === abs.background()) { | ||
abs.addChild(prm); | ||
abs.child([prm]); | ||
} else { | ||
@@ -141,17 +153,23 @@ abs.updChild(abs.background(), prm); | ||
/* getter */ | ||
let hdr = this.header().height(); | ||
let cnt = super.height(); | ||
if (('number' === typeof hdr) && (cnt === typeof cnt)) { | ||
return hdr + cnt; | ||
} | ||
return cnt; | ||
return mf.func.sizeSum(this.header().height(), super.height()); | ||
} | ||
/* setter */ | ||
if ('number' === typeof prm) { | ||
if (prm < this.header().height()) { | ||
throw new Error('invalid parameter'); | ||
let hdr_hei = mofron.func.getSize(this.header().height()); | ||
if ( (this.sizeType() !== hdr_hei[1]) || | ||
(0 > (prm - hdr_hei[0])) ) { | ||
super.height(prm); | ||
return; | ||
} | ||
prm = prm - this.header().height(); | ||
super.height(prm - hdr_hei[0]); | ||
} else if ('string' === typeof prm) { | ||
let dif_siz = mf.func.diffSize(prm, this.header().height()); | ||
if ((null === dif_siz) || (0 > mf.func.getSize(dif_siz)[0])) { | ||
super.height(prm); | ||
} else { | ||
super.height(dif_siz); | ||
} | ||
} else { | ||
throw new Error('invalid parameter'); | ||
} | ||
super.height(prm); | ||
} catch (e) { | ||
@@ -158,0 +176,0 @@ console.error(e.stack); |
{ | ||
"name": "mofron-comp-appbase", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "application base component for mofron", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7942
171