mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
nav scrolling and sons
This commit is contained in:
@@ -113,6 +113,4 @@ swipe-handle {
|
||||
width: $swipe-handle-width;
|
||||
height: 100%;
|
||||
z-index: $z-index-swipe-handle;
|
||||
background: red;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user