mofron-comp-text
Advanced tools
Comparing version 0.7.2 to 0.7.3
34
index.js
@@ -5,2 +5,3 @@ /** | ||
*/ | ||
let mf = require('mofron'); | ||
@@ -33,3 +34,3 @@ /** | ||
this.vdom().addChild( | ||
new mofron.Dom('div', this) | ||
new mf.Dom('div', this) | ||
); | ||
@@ -91,3 +92,5 @@ | ||
/* getter */ | ||
return mofron.func.getLength(this.style('font-size')); | ||
return mf.func.getLength( | ||
this.style('font-size') | ||
); | ||
} | ||
@@ -115,6 +118,6 @@ /* setter */ | ||
/* getter */ | ||
return mofron.func.getColorObj(this.style('color')); | ||
return mf.func.getColorObj(this.style('color')); | ||
} | ||
/* setter */ | ||
if (false === mofron.func.isObject(clr, 'Color')) { | ||
if (false === mf.func.isInclude(clr, 'Color')) { | ||
throw new Error('invalid parameter'); | ||
@@ -147,3 +150,3 @@ } | ||
var _thm = (undefined === thm) ? false : thm; | ||
if ( (false === mofron.func.isObject(fnt, 'Font')) || | ||
if ( (false === mf.func.isInclude(fnt, 'Font')) || | ||
('boolean' !== typeof _thm) ) { | ||
@@ -168,4 +171,25 @@ throw new Error('invalid parameter'); | ||
} | ||
space (val) { | ||
try { | ||
if (undefined === val) { | ||
/* getter */ | ||
return mf.func.getLength( | ||
this.style('letter-spacing') | ||
); | ||
} | ||
/* setter */ | ||
if ('number' !== typeof val) { | ||
throw new Error('invalid parameter'); | ||
} | ||
this.style({ | ||
'letter-spacing' : val + 'px' | ||
}); | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
} | ||
mofron.comp.text = {}; | ||
module.exports = mofron.comp.Text; |
{ | ||
"name": "mofron-comp-text", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "text component for mofron", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
8042
179