Merge pull request #3110 from NativeScript/vchimev-flexbox

Update flexbox css test page
This commit is contained in:
Vasil Chimev
2016-11-17 17:55:47 +02:00
committed by GitHub
3 changed files with 10 additions and 22 deletions

View File

@ -1,13 +0,0 @@
#container {
border-color: black;
border-width: 1;
margin: 5;
}
#container>Label {
border-width: 2;
border-color: black;
border-radius: 5;
}
#container>Label[selected="yes"] {
border-color: gray;
}

View File

@ -1,21 +1,20 @@
export function resetStyles(args) {
args.object.page.css = "#container { border-color: black; border-width: 1; margin: 5; } #container>Label { border-width: 2; border-color: black; border-radius: 5; }";
}
export const flexFlow = applyCss();
function applyCss() {
return function(args) {
// args.object.page.getViewById("container")[what] = args.object.text;
let boxCss = " #container { " + args.object.tag + " }" ;
// console.log(boxCss);
args.object.page.addCss(boxCss);
console.log(args.object.page.css);
// console.log(args.object.page.css);
}
}
export function applyStyles(args) {
// var css = "#test-element { " + args.object.tag + " }";
console.log(args.object.tag);
resetStyles(args);
// console.log(args.object.tag);
args.object.page.addCss(args.object.tag);
}
export function resetTap(args) {
args.object.page.css = "";
}

View File

@ -1,7 +1,9 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" android:actionBarHidden="true" loaded="onLoaded">
<Page xmlns="http://schemas.nativescript.org/tns.xsd" android:actionBarHidden="true" loaded="resetStyles">
<GridLayout rows="200, *">
<FlexboxLayout style="flex-wrap: wrap;">
<Button text="r" tap="resetStyles" automationText="reset" />
<!--container-->
<Button text="f" tag="flex-flow: row-reverse wrap-reverse;" tap="flexFlow" automationText="flexFlow" />