fix some helper functions.

This commit is contained in:
Christopher Jeffrey 2015-06-03 01:08:49 -07:00
parent b962994201
commit 983b5a745a

View File

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