Moving to flexbox for vertical components

This commit is contained in:
Max Lynch
2013-11-28 11:30:11 -06:00
parent 81f9b27c55
commit 3ea744c95a
4 changed files with 71 additions and 52 deletions

56
dist/css/ionic.css vendored
View File

@@ -2246,11 +2246,14 @@ body, .ionic-body {
.scroll-content {
position: relative;
width: 100%;
height: 100%;
top: 0;
left: 0;
overflow: hidden; }
overflow: hidden;
width: auto;
-webkit-box-flex: 1;
-webkit-flex: 1;
-moz-box-flex: 1;
-moz-flex: 1;
-ms-flex: 1;
flex: 1; }
/**
* Scroll is the scroll view component available for complex and custom
@@ -2270,8 +2273,7 @@ body, .ionic-body {
transform: translateZ(0);
-webkit-transform-origin: left top;
-moz-transform-origin: left top;
transform-origin: left top;
width: 100%; }
transform-origin: left top; }
.scroll-refresher {
display: none;
@@ -2329,20 +2331,29 @@ body, .ionic-body {
position: static;
height: 100%; }
.has-header {
top: 44px; }
.has-subheader {
top: 88px; }
.has-footer {
bottom: 44px; }
.has-tabs {
bottom: 44px; }
.pane {
position: fixed;
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
-webkit-align-items: stretch;
-moz-align-items: stretch;
align-items: stretch;
-webkit-align-content: stretch;
-moz-align-content: stretch;
-ms-flex-line-pack: stretch;
align-content: stretch;
position: absolute;
top: 0;
right: 0;
bottom: 0;
@@ -2350,7 +2361,8 @@ body, .ionic-body {
z-index: 1;
width: 100%;
height: 100%;
background-color: #fff; }
background-color: #fff;
vertical-align: top; }
/**
* Typography
@@ -2669,7 +2681,7 @@ a.subdued {
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
position: absolute;
position: relative;
right: 0;
left: 0;
z-index: 10;

View File

@@ -55,33 +55,35 @@
</head>
<body>
<header-bar
title="'Title'"
type="bar-primary"></header-bar>
<pane>
<header-bar
title="'Title'"
type="bar-primary"></header-bar>
<content
on-refresh="onRefresh()"
on-refresh-opening="onRefreshOpening(amount)"
refresh-complete="refreshComplete"
has-header="true"
has-footer="true"
>
<refresher></refresher>
<ul class="list" ng-controller="AppCtrl">
<li class="list-item" ng-repeat="item in items">asdf{{$index}}</li>
</ul>
</content>
<content
on-refresh="onRefresh()"
on-refresh-opening="onRefreshOpening(amount)"
refresh-complete="refreshComplete"
has-header="true"
has-footer="true"
>
<refresher></refresher>
<ul class="list" ng-controller="AppCtrl">
<li class="list-item" ng-repeat="item in items">asdf{{$index}}</li>
</ul>
</content>
<footer-bar type="bar-assertive">
<h1 class="title">Footer</h1>
</footer-bar>
<footer-bar type="bar-assertive">
<h1 class="title">Footer</h1>
</footer-bar>
</pane>
<script>
angular.module('navTest', ['ionic'])
.controller('AppCtrl', function($scope, $compile, $timeout, $element) {
$scope.items = [];
for(var i = 0; i < 200; i++) {
for(var i = 0; i < 70; i++) {
$scope.items.push({
});
}

View File

@@ -7,7 +7,7 @@
.bar {
@include display-flex();
@include user-select(none);
position: absolute;
position: relative;
right: 0;
left: 0;
z-index: 10;

View File

@@ -60,11 +60,10 @@ body, .ionic-body {
.scroll-content {
position: relative;
width: 100%;
height: 100%;
top: 0;
left: 0;
overflow: hidden;
width: auto;
@include flex(1);
}
/**
@@ -78,7 +77,6 @@ body, .ionic-body {
@include translateZ(0);
@include transform-origin(left, top);
width: 100%;
}
// Scroll refresher (for pull to refresh)
@@ -144,25 +142,30 @@ body, .ionic-body {
// Pad top/bottom of content so it doesn't hide behind .bar-title and .bar-tab.
// Note: For these to work, content must come after both bars in the markup
.has-header {
top: $bar-height;
//top: $bar-height;
}
.has-subheader {
top: $bar-height * 2;
//top: $bar-height * 2;
}
.has-footer {
bottom: $bar-height;
//bottom: $bar-height;
}
// Specify that a content area will have tabs
.has-tabs {
bottom: 44px;
//bottom: 44px;
}
// A full screen section with a solid background
.pane {
position: fixed;
@include flex-direction(column);
@include display-flex();
@include align-items(stretch);
@include align-content(stretch);
position: absolute;
top: 0;
right: 0;
bottom: 0;
@@ -171,4 +174,6 @@ body, .ionic-body {
width: 100%;
height: 100%;
background-color: #fff;
vertical-align: top;
}