attempts to fix things (un-compiled)

This commit is contained in:
Fox 2016-04-02 19:05:29 -07:00
parent a0b6d03c2b
commit 6586106a6f

View File

@ -4,17 +4,23 @@ import sub, len from string
path = sub ..., 1, len(...) - len "/box" path = sub ..., 1, len(...) - len "/box"
element = require "#{path}/element" element = require "#{path}/element"
util = sub path, 1, len(path) - len "/elements"
import inheritsFromElement from require "#{util}/util"
class text extends element class text extends element
wrap: (pop) -> wrap: (pop) ->
return (parent, ...) -> return (parent, ...) ->
if type(parent) == "string" if type(parent) == "string"
return pop.create("text", nil, parent, ...) return pop.create("text", nil, parent, ...)
else elseif inheritsFromElement parent
return pop.create("text", parent, ...) return pop.create("text", parent, ...)
--else
-- error "text wrapper failed", parent
new: (pop, parent, text="", color={255,255,255,255}) => new: (pop, parent, text="", color={255,255,255,255}) =>
print("---===---") print("---===---")
print(@, pop, parent, text, color) print(@, pop, parent, text, color)
print(pop.load)
print("---===---") print("---===---")
super pop, parent super pop, parent