mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Fixed #273 - android specific title sizes
This commit is contained in:
13
dist/css/ionic.css
vendored
13
dist/css/ionic.css
vendored
@@ -2823,7 +2823,6 @@ a.subdued {
|
||||
padding: 0 8px;
|
||||
min-width: initial;
|
||||
min-height: 31px;
|
||||
height: 32px;
|
||||
font-size: 12px;
|
||||
line-height: 30px; }
|
||||
.bar .button .icon, .bar .button.icon:before, .bar .button.icon-left:before, .bar .button.icon-right:before {
|
||||
@@ -2839,7 +2838,6 @@ a.subdued {
|
||||
padding-left: 2px; }
|
||||
.bar .button-bar > .button, .bar .buttons > .button {
|
||||
min-height: 31px;
|
||||
height: 32px;
|
||||
line-height: 30px; }
|
||||
.bar .button-bar + .button, .bar .button + .button-bar {
|
||||
margin-left: 5px; }
|
||||
@@ -6120,3 +6118,14 @@ a.button {
|
||||
top: 64px; }
|
||||
.platform-ios7 .has-subheader {
|
||||
top: 108px; }
|
||||
|
||||
.platform-android .bar-header {
|
||||
height: 48px; }
|
||||
.platform-android .has-header {
|
||||
top: 56px; }
|
||||
.platform-android .bar-subheader {
|
||||
top: 48px; }
|
||||
.platform-android .has-subheader {
|
||||
top: 96px; }
|
||||
.platform-android .title {
|
||||
line-height: 48px; }
|
||||
|
||||
30
dist/js/ionic.js
vendored
30
dist/js/ionic.js
vendored
@@ -1736,10 +1736,19 @@ window.ionic = {
|
||||
|
||||
this._checkPlatforms(platforms);
|
||||
|
||||
for(var i = 0; i < platforms.length; i++) {
|
||||
document.body.classList.add('platform-' + platforms[i]);
|
||||
}
|
||||
var classify = function() {
|
||||
if(!document.body) { return; }
|
||||
|
||||
for(var i = 0; i < platforms.length; i++) {
|
||||
document.body.classList.add('platform-' + platforms[i]);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener( "DOMContentLoaded", function(){
|
||||
classify();
|
||||
});
|
||||
|
||||
classify();
|
||||
},
|
||||
_checkPlatforms: function(platforms) {
|
||||
if(this.isCordova()) {
|
||||
@@ -1748,6 +1757,12 @@ window.ionic = {
|
||||
if(this.isIOS7()) {
|
||||
platforms.push('ios7');
|
||||
}
|
||||
if(this.isIPad()) {
|
||||
platforms.push('ipad');
|
||||
}
|
||||
if(this.isAndroid()) {
|
||||
platforms.push('android');
|
||||
}
|
||||
},
|
||||
|
||||
// Check if we are running in Cordova, which will have
|
||||
@@ -1757,11 +1772,20 @@ window.ionic = {
|
||||
//&& /^file:\/{3}[^\/]/i.test(window.location.href)
|
||||
//&& /ios|iphone|ipod|ipad|android/i.test(navigator.userAgent);
|
||||
},
|
||||
isIPad: function() {
|
||||
return navigator.userAgent.toLowerCase().indexOf('ipad') >= 0;
|
||||
},
|
||||
isIOS7: function() {
|
||||
if(!window.device) {
|
||||
return false;
|
||||
}
|
||||
return parseFloat(window.device.version) >= 7.0;
|
||||
},
|
||||
isAndroid: function() {
|
||||
if(!window.device) {
|
||||
return navigator.userAgent.toLowerCase().indexOf('android') >= 0;
|
||||
}
|
||||
return device.platform === "Android";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
<tab title="Home" icon-on="icon ion-ios7-filing" icon-off="icon ion-ios7-filing-outline" ng-controller="HomeCtrl">
|
||||
<header class="bar bar-header bar-positive">
|
||||
<button class="button button-clear button-primary" ng-click="newTask()">New</button>
|
||||
<button class="button button-icon" ng-click="newTask()"><i class="icon ion-navicon-round"></i></button>
|
||||
<h1 class="title">Tasks</h1>
|
||||
<button class="button button-clear button-primary" ng-click="isEditingItems = !isEditingItems">Edit</button>
|
||||
</header>
|
||||
|
||||
@@ -6,10 +6,19 @@
|
||||
|
||||
this._checkPlatforms(platforms);
|
||||
|
||||
for(var i = 0; i < platforms.length; i++) {
|
||||
document.body.classList.add('platform-' + platforms[i]);
|
||||
}
|
||||
var classify = function() {
|
||||
if(!document.body) { return; }
|
||||
|
||||
for(var i = 0; i < platforms.length; i++) {
|
||||
document.body.classList.add('platform-' + platforms[i]);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener( "DOMContentLoaded", function(){
|
||||
classify();
|
||||
});
|
||||
|
||||
classify();
|
||||
},
|
||||
_checkPlatforms: function(platforms) {
|
||||
if(this.isCordova()) {
|
||||
@@ -18,6 +27,12 @@
|
||||
if(this.isIOS7()) {
|
||||
platforms.push('ios7');
|
||||
}
|
||||
if(this.isIPad()) {
|
||||
platforms.push('ipad');
|
||||
}
|
||||
if(this.isAndroid()) {
|
||||
platforms.push('android');
|
||||
}
|
||||
},
|
||||
|
||||
// Check if we are running in Cordova, which will have
|
||||
@@ -27,11 +42,20 @@
|
||||
//&& /^file:\/{3}[^\/]/i.test(window.location.href)
|
||||
//&& /ios|iphone|ipod|ipad|android/i.test(navigator.userAgent);
|
||||
},
|
||||
isIPad: function() {
|
||||
return navigator.userAgent.toLowerCase().indexOf('ipad') >= 0;
|
||||
},
|
||||
isIOS7: function() {
|
||||
if(!window.device) {
|
||||
return false;
|
||||
}
|
||||
return parseFloat(window.device.version) >= 7.0;
|
||||
},
|
||||
isAndroid: function() {
|
||||
if(!window.device) {
|
||||
return navigator.userAgent.toLowerCase().indexOf('android') >= 0;
|
||||
}
|
||||
return device.platform === "Android";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
padding: 0 $button-bar-button-padding;
|
||||
min-width: initial;
|
||||
min-height: $button-bar-button-height - 1;
|
||||
height: $button-bar-button-height;
|
||||
//height: $button-bar-button-height;
|
||||
font-size: $button-bar-button-font-size;
|
||||
line-height: $button-bar-button-height - $button-border-width - 1;
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
.button-bar > .button, .buttons > .button {
|
||||
min-height: $button-bar-button-height - 1;
|
||||
height: $button-bar-button-height;
|
||||
//height: $button-bar-button-height;
|
||||
line-height: $button-bar-button-height - 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,3 +25,25 @@
|
||||
top: 108px;
|
||||
}
|
||||
}
|
||||
|
||||
.platform-android {
|
||||
.bar-header {
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.has-header {
|
||||
top: 56px;
|
||||
}
|
||||
|
||||
.bar-subheader {
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.has-subheader {
|
||||
top: 96px;
|
||||
}
|
||||
|
||||
.title {
|
||||
line-height: 48px;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user