nav scrolling and sons

This commit is contained in:
Adam Bradley
2015-05-28 13:45:07 -05:00
parent 14bc7e36fd
commit ce85cced9f
9 changed files with 46 additions and 19 deletions

View File

@@ -113,6 +113,4 @@ swipe-handle {
width: $swipe-handle-width;
height: 100%;
z-index: $z-index-swipe-handle;
background: red;
opacity: 0.5;
}

View File

@@ -2,9 +2,14 @@
// Content
// --------------------------------------------------
$content-background-color: #fff !default;
$content-container-background-color: #fff !default;
$content-background-color: #fff !default;
.nav-item-container {
.content-container {
background-color: $content-container-background-color;
}
ion-content {
background-color: $content-background-color;
}

View File

@@ -2,14 +2,18 @@
// iOS Content
// --------------------------------------------------
$nav-container-ios-background-color: #000 !default;
$content-ios-background-color: #efeff4 !default;
$content-container-ios-background-color: #000 !default;
$content-ios-background-color: #efeff4 !default;
.platform-ios .nav-item-container {
background-color: $nav-container-ios-background-color;
}
.platform-ios ion-content {
background-color: $content-ios-background-color;
.nav-ios {
.content-container {
background-color: $content-container-ios-background-color;
}
ion-content {
background-color: $content-ios-background-color;
}
}

View File

@@ -1,4 +1,4 @@
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
import {Parent} from 'angular2/src/core/annotations_impl/visibility';
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
import {View} from 'angular2/src/core/annotations_impl/view';
import {ElementRef} from 'angular2/src/core/compiler/element_ref';
@@ -47,7 +47,7 @@ new IonicComponent(Nav, {});
selector: '[navbar-anchor]'
})
class NavbarAnchor {
constructor(@Ancestor() nav: Nav, viewContainerRef: ViewContainerRef) {
constructor(@Parent() nav: Nav, viewContainerRef: ViewContainerRef) {
nav.navbarContainerRef = viewContainerRef;
}
}
@@ -57,7 +57,7 @@ class NavbarAnchor {
selector: '[content-anchor]'
})
class ContentAnchor {
constructor(@Ancestor() nav: Nav, elementRef: ElementRef) {
constructor(@Parent() nav: Nav, elementRef: ElementRef) {
nav.contentElementRef = elementRef;
}
}

View File

@@ -1,5 +1,5 @@
import {ElementRef} from 'angular2/angular2'
import {Ancestor} from 'angular2/src/core/annotations_impl/visibility';
import {Parent} from 'angular2/src/core/annotations_impl/visibility';
import {Directive} from 'angular2/src/core/annotations_impl/annotations';
import {Gesture} from 'ionic/gestures/gesture';
@@ -10,11 +10,9 @@ import {Nav} from './nav';
selector: 'swipe-handle'
})
export class SwipeHandle {
constructor(@Ancestor() nav: Nav, elementRef: ElementRef) {
constructor(@Parent() nav: Nav, elementRef: ElementRef) {
let gesture = new Gesture(elementRef.domElement);
this.hidden = true;
gesture.listen();
gesture.on('panend', onDragEnd);

View File

@@ -1,2 +1,15 @@
<ion-nav [initial]="initial"></ion-nav>
<style>
f {
display: block;
margin: 10px auto;
max-width: 200px;
height: 200px;
background: blue;
}
f:last-of-type {
background: red;
}
</style>

View File

@@ -13,4 +13,7 @@
<button class="button" (click)="push()">Push (Go to 2nd)</button>
</p>
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
</ion-content>

View File

@@ -19,6 +19,9 @@
<button class="button" (click)="push()">Push (Go to 3rd)</button>
</p>
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
</ion-content>
<!-- <ion-toolbar>

View File

@@ -11,4 +11,7 @@
<button class="button" (click)="pop()">Pop (Go back to 2nd)</button>
</p>
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
<f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f><f></f>
</ion-content>