mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +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 { TextBaseStyler as TBS } from "ui/text-base/text-base-styler";
|
||||
import {device} from "platform";
|
||||
let styleHandlersInitialized: boolean;
|
||||
|
||||
global.moduleMerge(common, exports);
|
||||
|
||||
@ -15,6 +16,10 @@ export class Button extends common.Button {
|
||||
super();
|
||||
|
||||
this._isPressed = false;
|
||||
if(!styleHandlersInitialized) {
|
||||
styleHandlersInitialized = true;
|
||||
ButtonStyler.registerHandlers();
|
||||
}
|
||||
}
|
||||
|
||||
get android(): android.widget.Button {
|
||||
@ -128,6 +133,4 @@ export class ButtonStyler implements style.Styler {
|
||||
TextBaseStyler.getLetterSpacingProperty), "Button");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ButtonStyler.registerHandlers();
|
||||
}
|
@ -45,10 +45,19 @@ function onFormattedTextPropertyChanged(data: dependencyObservable.PropertyChang
|
||||
|
||||
(<proxy.PropertyMetadata>formattedTextProperty.metadata).onSetNativeValue = onFormattedTextPropertyChanged;
|
||||
|
||||
let styleHandlersInitialized: boolean;
|
||||
export class TextBase extends view.View implements definition.TextBase, formattedString.FormattedStringView {
|
||||
public static textProperty = textProperty;
|
||||
public static formattedTextProperty = formattedTextProperty;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
if (!styleHandlersInitialized) {
|
||||
styleHandlersInitialized = true;
|
||||
tbs.TextBaseStyler.registerHandlers();
|
||||
}
|
||||
}
|
||||
|
||||
public _onBindingContextChanged(oldValue: any, newValue: any) {
|
||||
super._onBindingContextChanged(oldValue, newValue);
|
||||
if (this.formattedText) {
|
||||
@ -134,6 +143,4 @@ export class TextBase extends view.View implements definition.TextBase, formatte
|
||||
_requestLayoutOnTextChanged(): void {
|
||||
this.requestLayout();
|
||||
}
|
||||
}
|
||||
|
||||
tbs.TextBaseStyler.registerHandlers();
|
||||
}
|
Reference in New Issue
Block a user