From 3898d1502be2e406900139341dfa9f11a9f3fef8 Mon Sep 17 00:00:00 2001 From: Vasil Chimev Date: Thu, 4 Feb 2016 11:55:31 +0200 Subject: [PATCH 01/11] Update package.json for 1.6.0 --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2e8f80724..c83ec4177 100644 --- a/package.json +++ b/package.json @@ -36,12 +36,12 @@ }, "typings": "tns-core-modules.d.ts", "dependencies": { - "tns-core-modules-widgets": "1.6.0" + "tns-core-modules-widgets": "1.6.1" }, "nativescript": { "platforms": { - "ios": "1.3.0", - "android": "1.3.0" + "ios": "1.6.0", + "android": "1.6.0" } } -} \ No newline at end of file +} From 5144969ae0508d3ea4ea3da1e0b63c6740a65f22 Mon Sep 17 00:00:00 2001 From: Nedyalko Nikolov Date: Mon, 8 Feb 2016 11:58:15 +0200 Subject: [PATCH 02/11] Added support for in expressions. --- apps/tests/ui/bindable-tests.ts | 25 +++++++++++++++++++++++++ ui/core/bindable.ts | 3 +++ 2 files changed, 28 insertions(+) diff --git a/apps/tests/ui/bindable-tests.ts b/apps/tests/ui/bindable-tests.ts index ceaf16135..66c6ca4a9 100644 --- a/apps/tests/ui/bindable-tests.ts +++ b/apps/tests/ui/bindable-tests.ts @@ -963,3 +963,28 @@ export function test_SupportFunctionsInExpressions() { TKUnit.assertEqual(bindableObj.get("test"), "visible", "When anyColor is red test property should be visible."); } + +export function test_$ValueSupportWithinExpression() { + var model = new observable.Observable({ + "anyColor": "red", + "isVisible": function () { + return this.get("anyColor") === "red"; + } + }); + + var bindableObj = new bindable.Bindable(); + + bindableObj.bind({ + "sourceProperty": "$value", + "targetProperty": "test", + "expression": "$value.anyColor === 'red' ? 'red' : 'blue'" + }, model); + + model.set("anyColor", "blue"); + + TKUnit.assertEqual(bindableObj.get("test"), "blue", "When anyColor is blue test property should be blue too."); + + model.set("anyColor", "red"); + + TKUnit.assertEqual(bindableObj.get("test"), "red", "When anyColor is red test property should be red too."); +} \ No newline at end of file diff --git a/ui/core/bindable.ts b/ui/core/bindable.ts index 06ede876f..3eb0975f5 100644 --- a/ui/core/bindable.ts +++ b/ui/core/bindable.ts @@ -458,6 +458,9 @@ export class Binding { private prepareContextForExpression(model, expression) { var parentViewAndIndex; var parentView; + if (expression.indexOf(bc.bindingValueKey) > -1) { + model[bc.bindingValueKey] = model; + } if (expression.indexOf(bc.parentValueKey) > -1) { parentView = this.getParentView(this.target.get(), bc.parentValueKey).view; if (parentView) { From 7e400edbaed08425f946e999e7dd8440270c490d Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Mon, 8 Feb 2016 12:15:35 +0200 Subject: [PATCH 03/11] Fix android corner radius in cases when the radius is less than half the border width --- apps/ui-tests-app/css/background.xml | 1 + ui/styling/background.android.ts | 36 +++++++++++++++++++--------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/apps/ui-tests-app/css/background.xml b/apps/ui-tests-app/css/background.xml index 384b66d3a..a0455996d 100644 --- a/apps/ui-tests-app/css/background.xml +++ b/apps/ui-tests-app/css/background.xml @@ -45,6 +45,7 @@