set WP8 as a grade-b device

This commit is contained in:
Adam Bradley
2014-05-09 09:33:31 -05:00
parent 2ec01733a5
commit 4928b996d6
3 changed files with 12 additions and 2 deletions

View File

@@ -116,6 +116,8 @@
if(this.isAndroid() && version < 4.4) {
this.grade = (version < 4 ? 'c' : 'b');
} else if(this.isWindowsPhone()) {
this.grade = 'b';
}
}
}

View File

@@ -52,8 +52,8 @@
}
}
.platform-android2:not(.enable-transitions) * {
// disable transitions on Android 2
.platform-c:not(.enable-transitions) * {
// disable transitions on grade-c devices (Android 2)
-webkit-transition: none !important;
transition: none !important;
}

View File

@@ -276,6 +276,14 @@ describe('Ionic Platform Service', function() {
expect(ionic.Platform.grade).toEqual('a');
});
it('sets grade b from Windows Phone platform', function() {
window.cordova = {};
ionic.Platform.setPlatform('windowsphone');
ionic.Platform.setVersion('8.0');
ionic.Platform._checkPlatforms();
expect(ionic.Platform.grade).toEqual('b');
});
it('sets grade a from unknown platform', function() {
window.cordova = {};
ionic.Platform.setPlatform('whatever');