From 6586106a6f10ad5c369913c0def23d2be409bf5c Mon Sep 17 00:00:00 2001 From: Fox Date: Sat, 2 Apr 2016 19:05:29 -0700 Subject: [PATCH] attempts to fix things (un-compiled) --- src/pop/elements/text.moon | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pop/elements/text.moon b/src/pop/elements/text.moon index 0fa8185..03a1287 100644 --- a/src/pop/elements/text.moon +++ b/src/pop/elements/text.moon @@ -4,17 +4,23 @@ import sub, len from string path = sub ..., 1, len(...) - len "/box" element = require "#{path}/element" +util = sub path, 1, len(path) - len "/elements" +import inheritsFromElement from require "#{util}/util" + class text extends element wrap: (pop) -> return (parent, ...) -> if type(parent) == "string" return pop.create("text", nil, parent, ...) - else + elseif inheritsFromElement parent return pop.create("text", parent, ...) + --else + -- error "text wrapper failed", parent new: (pop, parent, text="", color={255,255,255,255}) => print("---===---") print(@, pop, parent, text, color) + print(pop.load) print("---===---") super pop, parent