Skip to content

Commit

Permalink
set WP8 as a grade-b device
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bradley committed May 9, 2014
1 parent 2ec0173 commit 4928b99
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions js/utils/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@

if(this.isAndroid() && version < 4.4) {
this.grade = (version < 4 ? 'c' : 'b');
} else if(this.isWindowsPhone()) {
this.grade = 'b';
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions scss/_platform.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 8 additions & 0 deletions test/unit/angular/service/platform.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 4928b99

Please sign in to comment.