diff --git a/lib/helpers.js b/lib/helpers.js index 81dcdac..6f651ed 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -94,7 +94,7 @@ helpers.escape = function(text) { }; helpers.parseTags = function(text) { - return Element.prototype._parseTags.call( + return helpers.Element.prototype._parseTags.call( { parseTags: true, screen: Screen.global }, text); }; @@ -128,7 +128,7 @@ helpers.generateTags = function(style, text) { }; helpers.attrToBinary = function(style, element) { - return Element.prototype.sattr.call(element || {}, style); + return helpers.Element.prototype.sattr.call(element || {}, style); }; helpers.stripTags = function(text) { @@ -149,3 +149,10 @@ helpers.dropUnicode = function(text) { .replace(unicode.chars.combining, '') .replace(unicode.chars.surrogate, '?'); }; + +helpers.__defineGetter__('Element', function() { + if (!helpers._element) { + helpers._element = require('./widgets/element'); + } + return helpers._element; +});