apps updated

This commit is contained in:
Vladimir Enchev
2015-11-12 14:31:14 +02:00
parent 93cf00389e
commit 44a4324166
4 changed files with 26 additions and 24 deletions

View File

@ -1,17 +1,18 @@
var obj;
export function loaded(args) {
obj = args.object;
}
import view = require("ui/core/view");
import observable = require("data/observable");
import label = require("ui/label");
export function butonTap(args) {
if (obj.style.textDecoration === "underline") {
obj.style.textDecoration = "line-through";
} else if (obj.style.textDecoration === "line-through") {
obj.style.textDecoration = "line-through underline";
} else if (obj.style.textDecoration === "line-through underline") {
obj.style.textDecoration = "none";
} else if (obj.style.textDecoration === "none") {
obj.style.textDecoration = "underline";
var btn = <view.View>args.object;
var lbl = <label.Label>btn.parent.getViewById("Label1");
if (lbl.style.textDecoration === "underline") {
lbl.style.textDecoration = "line-through";
} else if (lbl.style.textDecoration === "line-through") {
lbl.style.textDecoration = "line-through underline";
} else if (lbl.style.textDecoration === "line-through underline") {
lbl.style.textDecoration = "none";
} else if (lbl.style.textDecoration === "none") {
lbl.style.textDecoration = "underline";
}
}

View File

@ -2,7 +2,7 @@
<ScrollView>
<StackLayout>
<Button text="Change" tap="butonTap" />
<Label text="Text" style.textDecoration="underline" loaded="loaded"/>
<Label id="Label1" text="Text" style.textDecoration="underline" />
<Label text="Label" style="text-decoration:none" />
<Label text="Label" style="text-decoration:underline" />

View File

@ -1,13 +1,14 @@
var obj;
import view = require("ui/core/view");
import observable = require("data/observable");
import label = require("ui/label");
export function loaded(args) {
obj = args.object;
}
export function butonTap(args: observable.EventData) {
var btn = <view.View>args.object;
var lbl = <label.Label>btn.parent.getViewById("Label1");
export function butonTap(args) {
if (obj.style.whiteSpace === "normal") {
obj.style.whiteSpace = "nowrap";
} else if (obj.style.whiteSpace === "nowrap") {
obj.style.whiteSpace = "normal";
if (lbl.style.whiteSpace === "normal") {
lbl.style.whiteSpace = "nowrap";
} else if (lbl.style.whiteSpace === "nowrap") {
lbl.style.whiteSpace = "normal";
}
}

View File

@ -2,7 +2,7 @@
<ScrollView>
<StackLayout width="50">
<Button text="Change" tap="butonTap" />
<Label text="Text Text" style.whiteSpace="normal" loaded="loaded"/>
<Label id="Label1" text="Text Text" style.whiteSpace="normal" />
<Label text="Label Normal" style="white-space:normal" />
<Label text="Label Nowrap" style="white-space:nowrap" />