mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
set major and minor platform versions in body css
This commit is contained in:
10
dist/js/ionic-angular.js
vendored
10
dist/js/ionic-angular.js
vendored
@@ -2762,6 +2762,10 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
||||
updateHeaderData(data);
|
||||
});
|
||||
|
||||
$rootScope.$on('viewState.titleUpdated', function(e, data) {
|
||||
$scope.currentTitle = (data && data.title ? data.title : '');
|
||||
});
|
||||
|
||||
// If a nav page changes the left or right buttons, update our scope vars
|
||||
$scope.$parent.$on('viewState.leftButtonsChanged', function(e, data) {
|
||||
$scope.leftButtons = data;
|
||||
@@ -2823,10 +2827,16 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
|
||||
$scope.$emit('viewState.rightButtonsChanged', $scope.rightButtons);
|
||||
});
|
||||
|
||||
// watch for changes in the title
|
||||
var deregTitle = $scope.$watch('title', function(val) {
|
||||
$scope.$emit('viewState.titleUpdated', $scope);
|
||||
});
|
||||
|
||||
$scope.$on('$destroy', function(){
|
||||
// deregister on destroy
|
||||
deregLeftButtons();
|
||||
deregRightButtons();
|
||||
deregTitle();
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
2
dist/js/ionic-angular.min.js
vendored
2
dist/js/ionic-angular.min.js
vendored
File diff suppressed because one or more lines are too long
7
dist/js/ionic.js
vendored
7
dist/js/ionic.js
vendored
@@ -1794,20 +1794,23 @@ window.ionic = {
|
||||
|
||||
_checkPlatforms: function(platforms) {
|
||||
this.platforms = [];
|
||||
var v = this.version().toString().replace('.', '_');
|
||||
|
||||
if(this.isCordova()) {
|
||||
this.platforms.push('cordova');
|
||||
}
|
||||
if(this.isIOS()) {
|
||||
this.platforms.push('ios');
|
||||
this.platforms.push('ios' + parseInt(this.version(), 10));
|
||||
this.platforms.push('ios' + v.split('_')[0]);
|
||||
this.platforms.push('ios' + v);
|
||||
}
|
||||
if(this.isIPad()) {
|
||||
this.platforms.push('ipad');
|
||||
}
|
||||
if(this.isAndroid()) {
|
||||
this.platforms.push('android');
|
||||
this.platforms.push('android' + parseInt(this.version(), 10));
|
||||
this.platforms.push('android' + v.split('_')[0]);
|
||||
this.platforms.push('android' + v);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
6
dist/js/ionic.min.js
vendored
6
dist/js/ionic.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -35,6 +35,9 @@ describe('Ionic Platform Service', function() {
|
||||
ionic.Platform.setVersion(' ');
|
||||
expect(ionic.Platform.version()).toEqual(0);
|
||||
|
||||
ionic.Platform.setVersion('me-not-number');
|
||||
expect(ionic.Platform.version()).toEqual(0);
|
||||
|
||||
ionic.Platform.setVersion('');
|
||||
expect(ionic.Platform.version()).toEqual(0);
|
||||
|
||||
@@ -89,18 +92,20 @@ describe('Ionic Platform Service', function() {
|
||||
expect(ionic.Platform.platforms[0]).toEqual('cordova');
|
||||
expect(ionic.Platform.platforms[1]).toEqual('ios');
|
||||
expect(ionic.Platform.platforms[2]).toEqual('ios7');
|
||||
expect(ionic.Platform.platforms[3]).toEqual('ios7_9');
|
||||
});
|
||||
|
||||
it('sets android platforms', function() {
|
||||
window.cordova = {};
|
||||
ionic.Platform.setPlatform('android');
|
||||
ionic.Platform.setVersion('4.4.4');
|
||||
ionic.Platform.setVersion('4.2.3');
|
||||
|
||||
ionic.Platform._checkPlatforms()
|
||||
|
||||
expect(ionic.Platform.platforms[0]).toEqual('cordova');
|
||||
expect(ionic.Platform.platforms[1]).toEqual('android');
|
||||
expect(ionic.Platform.platforms[2]).toEqual('android4');
|
||||
expect(ionic.Platform.platforms[3]).toEqual('android4_2');
|
||||
});
|
||||
|
||||
it('is android', function() {
|
||||
|
||||
@@ -38,20 +38,23 @@
|
||||
|
||||
_checkPlatforms: function(platforms) {
|
||||
this.platforms = [];
|
||||
var v = this.version().toString().replace('.', '_');
|
||||
|
||||
if(this.isCordova()) {
|
||||
this.platforms.push('cordova');
|
||||
}
|
||||
if(this.isIOS()) {
|
||||
this.platforms.push('ios');
|
||||
this.platforms.push('ios' + parseInt(this.version(), 10));
|
||||
this.platforms.push('ios' + v.split('_')[0]);
|
||||
this.platforms.push('ios' + v);
|
||||
}
|
||||
if(this.isIPad()) {
|
||||
this.platforms.push('ipad');
|
||||
}
|
||||
if(this.isAndroid()) {
|
||||
this.platforms.push('android');
|
||||
this.platforms.push('android' + parseInt(this.version(), 10));
|
||||
this.platforms.push('android' + v.split('_')[0]);
|
||||
this.platforms.push('android' + v);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user