aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/core/textable.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/core/textable.js')
-rw-r--r--src/modules/core/textable.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/modules/core/textable.js b/src/modules/core/textable.js
index 55df7c6..b0a0993 100644
--- a/src/modules/core/textable.js
+++ b/src/modules/core/textable.js
@@ -1,19 +1,25 @@
import { globals } from '../../utils/window.js'
// Create plain text node
-export function plain (text) {
+export function plain ( text ) {
+
// clear if build mode is disabled
- if (this._build === false) {
+ if ( this._build === false ) {
+
this.clear()
+
}
// create text node
- this.node.appendChild(globals.document.createTextNode(text))
+ this.node.appendChild( globals.document.createTextNode( text ) )
return this
+
}
// Get length of text element
export function length () {
+
return this.node.getComputedTextLength()
+
}