Do not use lazy requires where not needed.

This commit is contained in:
atanasovg
2016-01-25 16:33:18 +02:00
parent 62d85b0dc0
commit 56f1aaa795
63 changed files with 581 additions and 237 deletions

View File

@@ -7,6 +7,13 @@ import formattedString = require("text/formatted-string");
import * as weakEventListenerModule from "ui/core/weak-event-listener";
import tbs = require("ui/text-base/text-base-styler");
var weakEvents: typeof weakEventListenerModule;
function ensureWeakEvents() {
if (!weakEvents) {
weakEvents = require("ui/core/weak-event-listener");
}
}
var textProperty = new dependencyObservable.Property(
"text",
"TextBase",
@@ -76,7 +83,7 @@ export class TextBase extends view.View implements definition.TextBase, formatte
set formattedText(value: formattedString.FormattedString) {
if (this.formattedText !== value) {
var weakEvents: typeof weakEventListenerModule = require("ui/core/weak-event-listener");
ensureWeakEvents();
if (this.formattedText) {
weakEvents.removeWeakEventListener(this.formattedText, observable.Observable.propertyChangeEvent, this.onFormattedTextChanged, this);