diff --git a/src/components/app/_z-index.scss b/src/components/app/_z-index.scss index 11668fa7c9..6027994fd2 100644 --- a/src/components/app/_z-index.scss +++ b/src/components/app/_z-index.scss @@ -3,7 +3,8 @@ // -------------------------------------------------- -$z-index-action-menu: 110; -$z-index-alert: 100; -$z-index-content: 1; -$z-index-list-border: 50; +$z-index-action-menu: 110; +$z-index-alert: 100; +$z-index-content: 1; +$z-index-list-border: 50; +$z-index-toolbar-border: 20; diff --git a/src/components/app/ionic.scss b/src/components/app/ionic.scss index 4dcbbb1498..5150800e4a 100644 --- a/src/components/app/ionic.scss +++ b/src/components/app/ionic.scss @@ -41,7 +41,8 @@ // Android Components @import "../list/extensions/android", - "../item/extensions/android"; + "../item/extensions/android", + "../toolbar/extensions/android"; // iOS Components @@ -50,7 +51,8 @@ "../list/extensions/ios", "../item/extensions/ios", "../radio/extensions/ios", - "../switch/extensions/ios"; + "../switch/extensions/ios", + "../toolbar/extensions/ios"; // Icons diff --git a/src/components/toolbar/extensions/android.scss b/src/components/toolbar/extensions/android.scss new file mode 100644 index 0000000000..99ae60c739 --- /dev/null +++ b/src/components/toolbar/extensions/android.scss @@ -0,0 +1,18 @@ + +// Android Toolbar +// -------------------------------------------------- + + +.toolbar-android { + + .spacer { + @include flex(none); + } + + .title { + position: static; + margin: 0; + text-align: left; + } + +} diff --git a/src/components/toolbar/extensions/ios.scss b/src/components/toolbar/extensions/ios.scss new file mode 100644 index 0000000000..a0339ebb27 --- /dev/null +++ b/src/components/toolbar/extensions/ios.scss @@ -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; + } + +} diff --git a/src/components/toolbar/test/basic/e2e.js b/src/components/toolbar/test/basic/e2e.js new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/components/toolbar/test/basic/e2e.js @@ -0,0 +1 @@ + diff --git a/src/components/view/test/basic/main.html b/src/components/toolbar/test/basic/main.html similarity index 52% rename from src/components/view/test/basic/main.html rename to src/components/toolbar/test/basic/main.html index 987ec59d53..106a4506a2 100644 --- a/src/components/view/test/basic/main.html +++ b/src/components/toolbar/test/basic/main.html @@ -6,15 +6,15 @@ - - - - + + + + - - + + diff --git a/src/components/view/test/basic/main.js b/src/components/toolbar/test/basic/main.js similarity index 100% rename from src/components/view/test/basic/main.js rename to src/components/toolbar/test/basic/main.js diff --git a/src/components/toolbar/toolbar.js b/src/components/toolbar/toolbar.js index ddffb6b4c8..f243a71361 100644 --- a/src/components/toolbar/toolbar.js +++ b/src/components/toolbar/toolbar.js @@ -8,39 +8,38 @@ import {NgElement, Component, Template} from 'angular2/angular2' }) @Template({ inline: ` -
-
- -
-
- {{ title }} - -
+
+ +
+
+ {{ title }} +
+
+ +
+
+
+ +
` }) export class Toolbar { constructor(@NgElement() ngEle:NgElement) { this.ele = ngEle.domElement + this.ele.classList.add('toolbar') + this.ele.classList.add('toolbar-ios') window.requestAnimationFrame(() => { this.alignTitle() }) - } alignTitle(ele) { diff --git a/src/components/toolbar/toolbar.scss b/src/components/toolbar/toolbar.scss index c9adc079c6..f352f65b18 100644 --- a/src/components/toolbar/toolbar.scss +++ b/src/components/toolbar/toolbar.scss @@ -2,7 +2,7 @@ // Toolbar // -------------------------------------------------- -.bar { +.toolbar { position: relative; @include flex-display(); @include flex-direction(row); @@ -19,8 +19,8 @@ } .bar-items { - @include flex(1); @include flex-display(); + @include flex(1); @include flex-justify-content(space-between); } @@ -36,10 +36,9 @@ right: 0; bottom: 0; left: 0; - background: maroon; - @include flex(1); @include flex-display(); + @include flex(1); @include flex-align-items(center); } @@ -49,33 +48,15 @@ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - background: blue; } .back-button { @include flex-display(); - background: purple; .back-button-icon { - background: orange; } } .bar-items > .spacer { @include flex(1); } - -.bar-android { - - .spacer { - @include flex(none); - } - - .title { - position: static; - margin: 0; - text-align: left; - } - -} -