Skip to content

Commit

Permalink
fix page component
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 8, 2017
1 parent fda4f19 commit e9e1c6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/pages/discover/exam-detail/exam-detail.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component, ViewChild, ElementRef} from "@angular/core";
import {PageObject, AnimationReadyEvent} from "../../effect/paging-conponents";
import {BodyContent} from "./body-content";
import {NavParams, NavController, GestureController, Animation} from "ionic-angular";
import {NavParams, NavController, GestureController, Animation, Platform} from "ionic-angular";
import {QUIZS} from "../../../data/QUIZS";
import * as _ from "lodash";

Expand All @@ -22,7 +22,7 @@ export class ExamDetailPage {
private allQuestions;
private questionsWithShuffle;

constructor(public params: NavParams, public nav: NavController, public gestureController: GestureController) {
constructor(public params: NavParams, public nav: NavController, public gestureController: GestureController, public plt: Platform) {
this.domain = params.get("domain");
this.allQuestions = QUIZS[this.domain];
this.questionsWithShuffle = this.shuffleQuestion(this.allQuestions);
Expand Down Expand Up @@ -78,7 +78,7 @@ export class ExamDetailPage {
private exchangeAnimation(previousIndex, selectedIndex) {
let component = this.content.nativeElement.querySelectorAll('body-content > ion-nav ng-component');
let currentComponent = component[this.activeIndex];
let componentAnimation = new Animation(currentComponent);
let componentAnimation = new Animation(this.plt, currentComponent);

if (previousIndex >= selectedIndex) {
componentAnimation
Expand Down
6 changes: 3 additions & 3 deletions src/pages/effect/paging-conponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class PagingComponent {
let previousDistanceNeededToMove = this.currentAmountShiftedInPx;
this.currentAmountShiftedInPx = centerPoint - selectedItemCenterPoint;

let animation = new Animation(this.container.nativeElement);
let animation = new Animation(this.plt, this.container.nativeElement);
animation.fromTo("translateX", `${previousDistanceNeededToMove}px`, `${this.currentAmountShiftedInPx}px`);

for (let i = 0; i < pagingCircleWrapperElements.length; i++) {
Expand All @@ -111,7 +111,7 @@ export class PagingComponent {
if (this.ignoreFirst) {
this.ignoreFirst = false;
} else {
let circleAnimation = new Animation(this.zoomCircleRef.nativeElement);
let circleAnimation = new Animation(this.plt, this.zoomCircleRef.nativeElement);
let animationOriginY = pagingCircleWrapperElements[newIndex].nativeElement.offsetTop + SMALL_CIRCLE_DIAMETER / 2;

let circleXOrigin = selectedItemCenterPoint - SMALL_CIRCLE_DIAMETER / 2;
Expand Down Expand Up @@ -148,7 +148,7 @@ export class PagingComponent {
}

buildChildAnimation(selectedIndex:number, currentIndex:number, pagingCircleWrapperRef:ElementRef, originalOffset:number, newOffset:number) {
let animation = new Animation(pagingCircleWrapperRef.nativeElement);
let animation = new Animation(this.plt, pagingCircleWrapperRef.nativeElement);
let circleElement = <HTMLElement> pagingCircleWrapperRef.nativeElement.children[0];
let innerCircleElement = circleElement.children[0];
let circleAnimation = new Animation(this.plt, circleElement);
Expand Down

0 comments on commit e9e1c6c

Please sign in to comment.