fix some helper functions.
This commit is contained in:
parent
b962994201
commit
983b5a745a
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue