From dd9e70fc6c814593eadfcf9354f70e7cde7fb99a Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 15 May 2015 17:27:26 +0300 Subject: [PATCH] more fixes --- .../tests/xml-declaration/xml-declaration-tests.ts | 8 ++++---- ui/builder/component-builder.ts | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/apps/tests/xml-declaration/xml-declaration-tests.ts b/apps/tests/xml-declaration/xml-declaration-tests.ts index a22ee3190..269def545 100644 --- a/apps/tests/xml-declaration/xml-declaration-tests.ts +++ b/apps/tests/xml-declaration/xml-declaration-tests.ts @@ -130,14 +130,14 @@ export function test_parse_ShouldParseBooleanPropertiesIgnoreCaseInverted() { TKUnit.assert(tf.editable === false, "Expected result: false; Actual result: " + tf.editable + "; type: " + typeof (tf.editable)); }; -export function test_parse_ShouldParsePlatofmrSpecificProperties() { +export function test_parse_ShouldParsePlatformSpecificProperties() { var p = builder.parse(""); var tf = p.content; - if(platform.device.os === platform.platformNames.ios) { - TKUnit.assert(tf.editable === true, "Expected result: true; Actual result: " + tf.editable + "; type: " + typeof (tf.editable)); + if (platform.device.os === platform.platformNames.ios) { + TKUnit.assert(tf.editable === false, "Expected result: false; Actual result: " + tf.editable + "; type: " + typeof (tf.editable)); } else { - TKUnit.assert(tf.editable === false, "Expected result: false; Actual result: " + tf.editable + "; type: " + typeof (tf.editable)); + TKUnit.assert(tf.editable === true, "Expected result: true; Actual result: " + tf.editable + "; type: " + typeof (tf.editable)); } }; diff --git a/ui/builder/component-builder.ts b/ui/builder/component-builder.ts index afbabad5e..e926ed8fe 100644 --- a/ui/builder/component-builder.ts +++ b/ui/builder/component-builder.ts @@ -77,12 +77,14 @@ export function getComponentModule(elementName: string, namespace: string, attri var attrValue = attributes[attr]; - if (attr.indexOf(":") !== -1){ - var platformName = attr.split(":")[0].trim(); - if(platformName.toLowerCase() !== platform.device.os.toLowerCase()) { - continue; - } - } + if (attr.indexOf(":") !== -1) { + var platformName = attr.split(":")[0].trim(); + if (platformName.toLowerCase() === platform.device.os.toLowerCase()) { + attr = attr.split(":")[1].trim(); + } else { + continue; + } + } if (attr.indexOf(".") !== -1) { var subObj = instance;