From fc89e86c838f7628c2f49a0736405a0159b8b618 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 15 Sep 2015 16:14:08 -0500 Subject: [PATCH] iOS title centering improvements wip --- ionic/components/menu/test/basic/page1.html | 12 +++++++++++ ionic/components/toolbar/modes/ios.scss | 14 ++++++++++--- ionic/components/toolbar/toolbar.ts | 22 ++++++++++----------- 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/ionic/components/menu/test/basic/page1.html b/ionic/components/menu/test/basic/page1.html index 3a65a14d01..ca92af4052 100644 --- a/ionic/components/menu/test/basic/page1.html +++ b/ionic/components/menu/test/basic/page1.html @@ -9,6 +9,18 @@ Menu + + + + + + + + diff --git a/ionic/components/toolbar/modes/ios.scss b/ionic/components/toolbar/modes/ios.scss index 7251257e19..2d9b1aca45 100644 --- a/ionic/components/toolbar/modes/ios.scss +++ b/ionic/components/toolbar/modes/ios.scss @@ -6,7 +6,6 @@ $toolbar-order-ios: ( back-button: 10, menu-toggle: 20, primary: 30, - title: 40, secondary: 50 ); @@ -22,14 +21,23 @@ $toolbar-ios-title-font-size: 1.7rem !default; min-height: $toolbar-ios-height; .toolbar-title { - order: map-get($toolbar-order-ios, title); + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + padding: 0px 72px; + pointer-events: none; } .toolbar-primary-item { + flex: 1; order: map-get($toolbar-order-ios, primary); } .toolbar-secondary-item { + flex: 1; + text-align: right; order: map-get($toolbar-order-ios, secondary); } @@ -42,7 +50,7 @@ $toolbar-ios-title-font-size: 1.7rem !default; font-size: $toolbar-ios-title-font-size; font-weight: 500; text-align: center; - margin-top: -2px; + pointer-events: auto; } .back-button { diff --git a/ionic/components/toolbar/toolbar.ts b/ionic/components/toolbar/toolbar.ts index c9ccaaee6a..5e4e399aa7 100644 --- a/ionic/components/toolbar/toolbar.ts +++ b/ionic/components/toolbar/toolbar.ts @@ -52,17 +52,17 @@ export class ToolbarBase extends Ion { } afterViewChecked() { - if (this._queueAlign) { - this._queueAlign = false; - this._alignTitle(); - } + // if (this._queueAlign) { + // this._queueAlign = false; + // this._alignTitle(); + // } } /** * TODO */ alignTitle() { - this._queueAlign = (this.titleAlign === 'center'); + //this._queueAlign = (this.titleAlign === 'center'); } _alignTitle() { @@ -139,14 +139,14 @@ export class Toolbar extends ToolbarBase { super.onInit(); // TODO: THIS IS HORRIBLE, FIX - setTimeout(() => { - this.alignTitle(); + // setTimeout(() => { + // this.alignTitle(); - setTimeout(() => { - this.alignTitle() - }, 64); + // setTimeout(() => { + // this.alignTitle() + // }, 64); - }, 32); + // }, 32); } }