toolbar stuff and things

This commit is contained in:
Adam Bradley
2015-03-30 21:45:04 -05:00
parent 6863dcf1da
commit 4acbd5f347
9 changed files with 110 additions and 55 deletions

View File

@ -7,3 +7,4 @@ $z-index-action-menu: 110;
$z-index-alert: 100; $z-index-alert: 100;
$z-index-content: 1; $z-index-content: 1;
$z-index-list-border: 50; $z-index-list-border: 50;
$z-index-toolbar-border: 20;

View File

@ -41,7 +41,8 @@
// Android Components // Android Components
@import @import
"../list/extensions/android", "../list/extensions/android",
"../item/extensions/android"; "../item/extensions/android",
"../toolbar/extensions/android";
// iOS Components // iOS Components
@ -50,7 +51,8 @@
"../list/extensions/ios", "../list/extensions/ios",
"../item/extensions/ios", "../item/extensions/ios",
"../radio/extensions/ios", "../radio/extensions/ios",
"../switch/extensions/ios"; "../switch/extensions/ios",
"../toolbar/extensions/ios";
// Icons // Icons

View File

@ -0,0 +1,18 @@
// Android Toolbar
// --------------------------------------------------
.toolbar-android {
.spacer {
@include flex(none);
}
.title {
position: static;
margin: 0;
text-align: left;
}
}

View File

@ -0,0 +1,53 @@
// iOS Toolbar
// --------------------------------------------------
$toolbar-ios-height: 44px !default;
$toolbar-ios-background: #f7f7f8 !default;
$toolbar-ios-border-color: #c4c4c4 !default;
$toolbar-ios-title-font-size: 17px !default;
$toolbar-ios-button-font-size: 17px !default;
$toolbar-ios-button-color: #007aff !default;
.toolbar-ios {
height: $toolbar-ios-height;
background: $toolbar-ios-background;
&:after {
position: absolute;
top: auto;
right: auto;
bottom: 0;
left: 0;
z-index: $z-index-toolbar-border;
display: block;
width: 100%;
height: 1px;
background-color: $toolbar-ios-border-color;
@include transform-origin(50%, 100%);
content: '';
}
.title {
font-size: $toolbar-ios-title-font-size;
text-align: center;
}
.button {
font-size: $toolbar-ios-button-font-size;
color: $toolbar-ios-button-color;
border: none;
padding: 0;
margin: 0 10px;
min-height: $toolbar-ios-height;
min-width: 0;
background: transparent;
}
}

View File

@ -0,0 +1 @@

View File

@ -6,15 +6,15 @@
</ion-view-title> </ion-view-title>
<ion-nav-items side="primary"> <ion-nav-items side="primary">
<button>p1</button> <button class="button">p1</button>
<button>p2</button> <button class="button">p2</button>
<button>p3</button> <button class="button">p3</button>
<button>p4</button> <button class="button">p4</button>
</ion-nav-items> </ion-nav-items>
<ion-nav-items side="secondary"> <ion-nav-items side="secondary">
<button>s1</button> <button class="button">s1</button>
<button>s2</button> <button class="button">s2</button>
</ion-nav-items> </ion-nav-items>
<ion-content> <ion-content>

View File

@ -8,9 +8,8 @@ import {NgElement, Component, Template} from 'angular2/angular2'
}) })
@Template({ @Template({
inline: ` inline: `
<div class="bar bar-ios">
<div class="bar-items"> <div class="bar-items">
<button class="back-button bar-item"> <button class="button back-button bar-item">
<div class="back-button-icon">&lt;</div> <div class="back-button-icon">&lt;</div>
<div class="back-button-text"> <div class="back-button-text">
<div class="back-default">Back</div> <div class="back-default">Back</div>
@ -23,24 +22,24 @@ import {NgElement, Component, Template} from 'angular2/angular2'
<content select="ion-view-title"></content> <content select="ion-view-title"></content>
</div> </div>
</div> </div>
<div class="bar-item bar-primary-item" style="background:red"> <div class="bar-item bar-primary-item">
<content select="ion-nav-items[side=primary]"></content> <content select="ion-nav-items[side=primary]"></content>
</div> </div>
<div class="spacer"></div> <div class="spacer"></div>
<div class="bar-item bar-secondary-item" style="background:green"> <div class="bar-item bar-secondary-item">
<content select="ion-nav-items[side=secondary]"></content> <content select="ion-nav-items[side=secondary]"></content>
</div> </div>
</div>
</div>` </div>`
}) })
export class Toolbar { export class Toolbar {
constructor(@NgElement() ngEle:NgElement) { constructor(@NgElement() ngEle:NgElement) {
this.ele = ngEle.domElement this.ele = ngEle.domElement
this.ele.classList.add('toolbar')
this.ele.classList.add('toolbar-ios')
window.requestAnimationFrame(() => { window.requestAnimationFrame(() => {
this.alignTitle() this.alignTitle()
}) })
} }
alignTitle(ele) { alignTitle(ele) {

View File

@ -2,7 +2,7 @@
// Toolbar // Toolbar
// -------------------------------------------------- // --------------------------------------------------
.bar { .toolbar {
position: relative; position: relative;
@include flex-display(); @include flex-display();
@include flex-direction(row); @include flex-direction(row);
@ -19,8 +19,8 @@
} }
.bar-items { .bar-items {
@include flex(1);
@include flex-display(); @include flex-display();
@include flex(1);
@include flex-justify-content(space-between); @include flex-justify-content(space-between);
} }
@ -36,10 +36,9 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
background: maroon;
@include flex(1);
@include flex-display(); @include flex-display();
@include flex(1);
@include flex-align-items(center); @include flex-align-items(center);
} }
@ -49,33 +48,15 @@
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
background: blue;
} }
.back-button { .back-button {
@include flex-display(); @include flex-display();
background: purple;
.back-button-icon { .back-button-icon {
background: orange;
} }
} }
.bar-items > .spacer { .bar-items > .spacer {
@include flex(1); @include flex(1);
} }
.bar-android {
.spacer {
@include flex(none);
}
.title {
position: static;
margin: 0;
text-align: left;
}
}