Skip to content

Commit 939fcaa

Browse files
committed
updated demo
1 parent 0df62a4 commit 939fcaa

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/app/tab1/tab1.page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</ion-item>
4040
</ion-list>
4141
</ion-content>
42-
<lib-ionic-pullup (onExpand)="footerExpanded()" (onCollapse)="footerCollapsed()" (dragged)="onDrag($event)" [(state)]="footerState" [toolbarTopMargin]="100" [minBottomVisible]="200" [dockable]="true">
42+
<lib-ionic-pullup (onExpand)="footerExpanded()" (onCollapse)="footerCollapsed()" (dragged)="onDrag($event)" [(state)]="footerState" [toolbarTopMargin]="toolbarMargin" [minBottomVisible]="200" [dockable]="true">
4343

4444
<ion-toolbar color="light" (click)="toggleFooter()" #ionDragFooter>
4545
<ion-title>Footer</ion-title>

src/app/tab1/tab1.page.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, OnInit, AfterViewInit } from '@angular/core';
22
import { IonPullUpFooterState, DraggedOutputEvent } from 'ionic-pullup';
33

44
@Component({
55
selector: 'app-tab1',
66
templateUrl: 'tab1.page.html',
77
styleUrls: ['tab1.page.scss']
88
})
9-
export class Tab1Page implements OnInit {
9+
export class Tab1Page implements OnInit, AfterViewInit {
1010
footerState: IonPullUpFooterState;
11+
toolbarMargin: number;
1112

1213
constructor() {}
1314

1415
ngOnInit() {
1516
this.footerState = IonPullUpFooterState.Collapsed;
1617
}
1718

19+
ngAfterViewInit() {
20+
// set top margin dynamically
21+
this.toolbarMargin = 100;
22+
}
23+
1824
footerExpanded() {
1925
console.log('Footer expanded!');
2026
}

0 commit comments

Comments
 (0)