mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
fix snapshot (#2544)
This commit is contained in:
@ -4,6 +4,7 @@ import dependencyObservable = require("ui/core/dependency-observable");
|
|||||||
import style = require("ui/styling/style");
|
import style = require("ui/styling/style");
|
||||||
import { TextBaseStyler as TBS } from "ui/text-base/text-base-styler";
|
import { TextBaseStyler as TBS } from "ui/text-base/text-base-styler";
|
||||||
import {device} from "platform";
|
import {device} from "platform";
|
||||||
|
let styleHandlersInitialized: boolean;
|
||||||
|
|
||||||
global.moduleMerge(common, exports);
|
global.moduleMerge(common, exports);
|
||||||
|
|
||||||
@ -15,6 +16,10 @@ export class Button extends common.Button {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
this._isPressed = false;
|
this._isPressed = false;
|
||||||
|
if(!styleHandlersInitialized) {
|
||||||
|
styleHandlersInitialized = true;
|
||||||
|
ButtonStyler.registerHandlers();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get android(): android.widget.Button {
|
get android(): android.widget.Button {
|
||||||
@ -129,5 +134,3 @@ export class ButtonStyler implements style.Styler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonStyler.registerHandlers();
|
|
@ -45,10 +45,19 @@ function onFormattedTextPropertyChanged(data: dependencyObservable.PropertyChang
|
|||||||
|
|
||||||
(<proxy.PropertyMetadata>formattedTextProperty.metadata).onSetNativeValue = onFormattedTextPropertyChanged;
|
(<proxy.PropertyMetadata>formattedTextProperty.metadata).onSetNativeValue = onFormattedTextPropertyChanged;
|
||||||
|
|
||||||
|
let styleHandlersInitialized: boolean;
|
||||||
export class TextBase extends view.View implements definition.TextBase, formattedString.FormattedStringView {
|
export class TextBase extends view.View implements definition.TextBase, formattedString.FormattedStringView {
|
||||||
public static textProperty = textProperty;
|
public static textProperty = textProperty;
|
||||||
public static formattedTextProperty = formattedTextProperty;
|
public static formattedTextProperty = formattedTextProperty;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
if (!styleHandlersInitialized) {
|
||||||
|
styleHandlersInitialized = true;
|
||||||
|
tbs.TextBaseStyler.registerHandlers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public _onBindingContextChanged(oldValue: any, newValue: any) {
|
public _onBindingContextChanged(oldValue: any, newValue: any) {
|
||||||
super._onBindingContextChanged(oldValue, newValue);
|
super._onBindingContextChanged(oldValue, newValue);
|
||||||
if (this.formattedText) {
|
if (this.formattedText) {
|
||||||
@ -135,5 +144,3 @@ export class TextBase extends view.View implements definition.TextBase, formatte
|
|||||||
this.requestLayout();
|
this.requestLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tbs.TextBaseStyler.registerHandlers();
|
|
||||||
|
Reference in New Issue
Block a user