lazily load Screen in helpers.js. fixes #164.
This commit is contained in:
parent
54430504d1
commit
e6a5b0cac9
|
@ -93,9 +93,9 @@ helpers.escape = function(text) {
|
|||
});
|
||||
};
|
||||
|
||||
helpers.parseTags = function(text) {
|
||||
helpers.parseTags = function(text, screen) {
|
||||
return helpers.Element.prototype._parseTags.call(
|
||||
{ parseTags: true, screen: Screen.global }, text);
|
||||
{ parseTags: true, screen: screen || helpers.Screen.global }, text);
|
||||
};
|
||||
|
||||
helpers.generateTags = function(style, text) {
|
||||
|
@ -150,6 +150,13 @@ helpers.dropUnicode = function(text) {
|
|||
.replace(unicode.chars.surrogate, '?');
|
||||
};
|
||||
|
||||
helpers.__defineGetter__('Screen', function() {
|
||||
if (!helpers._screen) {
|
||||
helpers._screen = require('./widgets/screen');
|
||||
}
|
||||
return helpers._screen;
|
||||
});
|
||||
|
||||
helpers.__defineGetter__('Element', function() {
|
||||
if (!helpers._element) {
|
||||
helpers._element = require('./widgets/element');
|
||||
|
|
Loading…
Reference in New Issue