mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
Break a circular import view-application-view.
By late-importing application in bindable and stylers-common.
This commit is contained in:
@ -1,8 +1,17 @@
|
||||
import view = require("ui/core/view");
|
||||
import application = require("application");
|
||||
import dependencyObservable = require("ui/core/dependency-observable");
|
||||
import types = require("utils/types");
|
||||
|
||||
//late import
|
||||
var _appModule = null;
|
||||
|
||||
function appModule() {
|
||||
if (!_appModule) {
|
||||
_appModule = require("application");
|
||||
}
|
||||
return _appModule;
|
||||
}
|
||||
|
||||
var _defaultNativeValuesCache = {};
|
||||
|
||||
export class StylePropertyChangedHandler {
|
||||
@ -26,10 +35,9 @@ export class StylePropertyChangedHandler {
|
||||
_defaultNativeValuesCache[className + property.id] = this._getNativeValue(view);
|
||||
}
|
||||
|
||||
if (application.android) {
|
||||
if (appModule().android) {
|
||||
newValue = newValue.android ? newValue.android : newValue;
|
||||
}
|
||||
else if (application.ios) {
|
||||
} else if (appModule().ios) {
|
||||
newValue = newValue.ios ? newValue.ios : newValue;
|
||||
}
|
||||
|
||||
@ -40,4 +48,4 @@ export class StylePropertyChangedHandler {
|
||||
var className = types.getClass(view);
|
||||
this._resetProperty(view, _defaultNativeValuesCache[className + property.id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user