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));
};
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 tf = <textFieldModule.TextField>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));
} else {
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 === true, "Expected result: true; Actual result: " + tf.editable + "; type: " + typeof (tf.editable));
}
};

View File

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