navbar aside menu button

This commit is contained in:
Adam Bradley
2015-09-01 15:42:45 -05:00
parent d0c9f1404e
commit 4952cf58fb
10 changed files with 88 additions and 100 deletions

View File

@@ -4,9 +4,10 @@
$toolbar-order-ios: (
back-button: 10,
primary: 20,
title: 30,
secondary: 40
aside-toggle: 20,
primary: 30,
title: 40,
secondary: 50
);
$toolbar-ios-height: 4.4rem !default;
@@ -33,6 +34,10 @@ $toolbar-ios-title-font-size: 1.7rem !default;
order: map-get($toolbar-order-ios, secondary);
}
[aside-toggle] {
order: map-get($toolbar-order-ios, 'aside-toggle');
}
ion-title {
font-size: $toolbar-ios-title-font-size;
font-weight: 500;

View File

@@ -4,9 +4,10 @@
$toolbar-order: (
backButton: 10,
title: 20,
primary: 30,
secondary: 40
aside-toggle: 20,
title: 30,
primary: 40,
secondary: 50
);
@@ -75,6 +76,19 @@ ion-title {
color: $toolbar-text-color;
}
.toolbar [aside-toggle] {
margin: 0;
padding: 0;
min-height: 32px;
min-width: 32px;
order: map-get($toolbar-order, 'aside-toggle');
box-shadow: none;
}
.toolbar [aside-toggle] icon {
padding: 0 0.9em;
}
.toolbar-item {
transform: translateZ(0px);
}

View File

@@ -51,12 +51,23 @@ export class ToolbarBase extends Ion {
return this._ttTxt;
}
onAllChangesDone() {
if (this._queueAlign) {
this._queueAlign = false;
this._alignTitle();
}
}
/**
* TODO
*/
alignTitle() {
this._queueAlign = (this.titleAlign === 'center');
}
_alignTitle() {
// don't bother if we're not trying to center align the title
if (this.titleAlign !== 'center' || this.aligned) return;
if (this.aligned) return;
// called after the navbar/title has had a moment to
// finish rendering in their correct locations