mirror of
https://github.com/donl/meteor-ionic.git
synced 2026-05-30 06:12:31 -06:00
fix title align issues on android
This commit is contained in:
parent
7095005b91
commit
6985ddbb7f
2 changed files with 11 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ IonHeaderBar = {
|
|||
var align = this.alignTitle || 'center';
|
||||
var $title = this.$('.title');
|
||||
|
||||
if (align === 'center' && Platform.isAndroid()) {
|
||||
if (Platform.isAndroid() && !this.alignTitle) {
|
||||
$title.addClass('title-left');
|
||||
return;
|
||||
}
|
||||
|
|
@ -33,7 +33,13 @@ IonHeaderBar = {
|
|||
rightButtonWidth = $rightButton.outerWidth();
|
||||
}
|
||||
|
||||
var margin = Math.max(leftButtonWidth, rightButtonWidth);
|
||||
// If we're on Android, we only care about the left button
|
||||
var margin;
|
||||
if (Platform.isAndroid()) {
|
||||
margin = leftButtonWidth;
|
||||
} else {
|
||||
margin = Math.max(leftButtonWidth, rightButtonWidth);
|
||||
}
|
||||
$title.css('left', margin);
|
||||
$title.css('right', margin);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ Template.ionNavBar.rendered = function () {
|
|||
|
||||
if (!$node.hasClass('title') && !$node.hasClass('button') || IonNavigation.skipTransitions) {
|
||||
$node.insertBefore(next);
|
||||
// Changing tabs skips transition animations, but we still want to update the position of the title
|
||||
IonHeaderBar.alignTitle.call(template);
|
||||
IonHeaderBar.positionTitle.call(template);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue