more fixes

This commit is contained in:
Vladimir Enchev
2015-05-15 17:27:26 +03:00
parent 3a80949ee7
commit dd9e70fc6c
2 changed files with 12 additions and 10 deletions

View File

@ -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)); 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 = <page.Page>builder.parse("<Page><TextField ios:editable='False' android:editable='True' /></Page>"); var p = <page.Page>builder.parse("<Page><TextField ios:editable='False' android:editable='True' /></Page>");
var tf = <textFieldModule.TextField>p.content; var tf = <textFieldModule.TextField>p.content;
if(platform.device.os === platform.platformNames.ios) { if (platform.device.os === platform.platformNames.ios) {
TKUnit.assert(tf.editable === true, "Expected result: true; Actual result: " + tf.editable + "; type: " + typeof (tf.editable)); TKUnit.assert(tf.editable === false, "Expected result: false; Actual result: " + tf.editable + "; type: " + typeof (tf.editable));
} else { } 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));
} }
}; };

View File

@ -77,12 +77,14 @@ export function getComponentModule(elementName: string, namespace: string, attri
var attrValue = <string>attributes[attr]; var attrValue = <string>attributes[attr];
if (attr.indexOf(":") !== -1){ if (attr.indexOf(":") !== -1) {
var platformName = attr.split(":")[0].trim(); var platformName = attr.split(":")[0].trim();
if(platformName.toLowerCase() !== platform.device.os.toLowerCase()) { if (platformName.toLowerCase() === platform.device.os.toLowerCase()) {
continue; attr = attr.split(":")[1].trim();
} } else {
} continue;
}
}
if (attr.indexOf(".") !== -1) { if (attr.indexOf(".") !== -1) {
var subObj = instance; var subObj = instance;