Skip to content

Commit 4a6086c

Browse files
committed
Revert "Merge branch 'master' of https://github.com/driftyco/ionic"
This reverts commit 8945bf9, reversing changes made to f4fac22.
1 parent 8945bf9 commit 4a6086c

File tree

86 files changed

+3827
-5481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3827
-5481
lines changed

src/animations/animation.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,11 @@ export class Animation {
289289
var self = this;
290290
var i: number;
291291

292-
let dur = this._dur;
293292
if (isDefined(opts.duration)) {
294-
dur = opts.duration;
293+
self._dur = opts.duration;
295294
}
296295

297-
console.debug('Animation, play, duration', dur, 'easing', this._easing);
296+
console.debug('Animation, play, duration', self._dur, 'easing', self._easing);
298297

299298
// always default that an animation does not tween
300299
// a tween requires that an Animation class has an element
@@ -314,7 +313,7 @@ export class Animation {
314313
// ensure all past transition end events have been cleared
315314
self._clearAsync();
316315

317-
if (dur > 30) {
316+
if (self._dur > 30) {
318317
// this animation has a duration, so it should animate
319318
// place all the elements with their FROM properties
320319

@@ -329,7 +328,7 @@ export class Animation {
329328
// set the async TRANSITION END event
330329
// and run onFinishes when the transition ends
331330
// ******** DOM WRITE ****************
332-
self._asyncEnd(dur, true);
331+
self._asyncEnd(self._dur, true);
333332

334333
// begin each animation when everything is rendered in their place
335334
// and the transition duration/easing is ready to go

src/components/alert/test/basic/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ class E2EPage {
304304
</ion-header>
305305
<ion-content padding>
306306
Hi, I'm Bob, and I'm a modal.
307-
<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>
308307
</ion-content>
309308
`
310309
})

src/components/app/app.ts

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Title } from '@angular/platform-browser';
44
import { ClickBlock } from '../../util/click-block';
55
import { Config } from '../../config/config';
66
import { NavController } from '../nav/nav-controller';
7-
import { isTabs, isNav } from '../nav/nav-controller-base';
87
import { NavOptions } from '../nav/nav-interfaces';
98
import { NavPortal } from '../nav/nav-portal';
109
import { Platform } from '../../platform/platform';
@@ -32,11 +31,6 @@ export class App {
3231
*/
3332
clickBlock: ClickBlock;
3433

35-
/**
36-
* @private
37-
*/
38-
appRoot: AppRoot;
39-
4034
viewDidLoad: EventEmitter<any> = new EventEmitter();
4135
viewWillEnter: EventEmitter<any> = new EventEmitter();
4236
viewDidEnter: EventEmitter<any> = new EventEmitter();
@@ -92,17 +86,6 @@ export class App {
9286
}
9387
}
9488

95-
/**
96-
* @private
97-
*/
98-
setScrollDisabled(disabled: boolean) {
99-
if (!this.appRoot) {
100-
console.error('appRoot is missing, scrolling can not be enabled/disabled');
101-
return;
102-
}
103-
this.appRoot.disableScroll = disabled;
104-
}
105-
10689
/**
10790
* @private
10891
* Boolean if the app is actively enabled or not.
@@ -196,7 +179,13 @@ export class App {
196179
// function used to climb up all parent nav controllers
197180
function navPop(nav: any): Promise<any> {
198181
if (nav) {
199-
if (isTabs(nav)) {
182+
if (nav.length && nav.length() > 1) {
183+
// this nav controller has more than one view
184+
// pop the current view on this nav and we're done here
185+
console.debug('app, goBack pop nav');
186+
return nav.pop();
187+
188+
} else if (nav.previousTab) {
200189
// FYI, using "nav instanceof Tabs" throws a Promise runtime error for whatever reason, idk
201190
// this is a Tabs container
202191
// see if there is a valid previous tab to go to
@@ -206,12 +195,6 @@ export class App {
206195
nav.select(prevTab);
207196
return Promise.resolve();
208197
}
209-
210-
} else if (isNav(nav) && nav.length() > 1) {
211-
// this nav controller has more than one view
212-
// pop the current view on this nav and we're done here
213-
console.debug('app, goBack pop nav');
214-
return nav.pop();
215198
}
216199

217200
// try again using the parent nav (if there is one)
@@ -245,9 +228,10 @@ export class App {
245228
console.debug('app, goBack exitApp');
246229
this._platform.exitApp();
247230
}
248-
}
249231

250-
return navPromise;
232+
} else {
233+
return navPromise;
234+
}
251235
}
252236

253237
return Promise.resolve();
@@ -298,13 +282,9 @@ export class AppRoot {
298282
@ViewChild('anchor', {read: ViewContainerRef}) private _viewport: ViewContainerRef;
299283

300284
constructor(
301-
private _cmp: UserComponent,
302-
private _cr: ComponentResolver,
303-
private _renderer: Renderer,
304-
app: App
305-
) {
306-
app.appRoot = this;
307-
}
285+
private _cmp: UserComponent,
286+
private _cr: ComponentResolver,
287+
private _renderer: Renderer) {}
308288

309289
ngAfterViewInit() {
310290
// load the user app's root component

src/components/app/structure.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ ion-content.js-scroll > scroll-content {
219219

220220
[nav-viewport],
221221
[nav-portal],
222+
[tab-portal],
222223
.nav-decor {
223224
display: none;
224225
}

src/components/app/test/animations/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {ionicBootstrap, Config, Animation} from '../../../../../src';
66
templateUrl: 'main.html'
77
})
88
class E2EPage {
9-
duration: string;
10-
easing: string;
9+
duration;
10+
easing;
1111

1212
constructor(config: Config) {
1313
this.duration = '1000';

src/components/app/test/app.spec.ts

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { Component } from '@angular/core';
2-
import { App, Config, Nav, NavOptions, Platform, Tab, Tabs, ViewController } from '../../../../src';
3-
import { mockNavController, mockTab, mockTabs } from '../../../../src/util/mock-providers';
1+
import {Component} from '@angular/core';
2+
import {App, Nav, Tabs, Tab, NavOptions, Config, ViewController, Platform} from '../../../../src';
43

54
export function run() {
65

6+
77
describe('App', () => {
88

99
describe('navPop', () => {
1010

1111
it('should select the previous tab', () => {
12-
let nav = mockNavController();
13-
let portal = mockNavController();
12+
let nav = mockNav();
13+
let portal = mockNav();
1414
app.setPortal(portal);
1515
app.setRootNav(nav);
1616

@@ -40,8 +40,8 @@ describe('App', () => {
4040
});
4141

4242
it('should pop from the active tab, when tabs is nested is the root nav', () => {
43-
let nav = mockNavController();
44-
let portal = mockNavController();
43+
let nav = mockNav();
44+
let portal = mockNav();
4545
app.setPortal(portal);
4646
app.setRootNav(nav);
4747

@@ -91,9 +91,9 @@ describe('App', () => {
9191
});
9292

9393
it('should pop the root nav when nested nav has less than 2 views', () => {
94-
let rootNav = mockNavController();
95-
let nestedNav = mockNavController();
96-
let portal = mockNavController();
94+
let rootNav = mockNav();
95+
let nestedNav = mockNav();
96+
let portal = mockNav();
9797
app.setPortal(portal);
9898
rootNav.registerChildNav(nestedNav);
9999
nestedNav.parent = rootNav;
@@ -120,9 +120,9 @@ describe('App', () => {
120120
});
121121

122122
it('should pop a view from the nested nav that has more than 1 view', () => {
123-
let rootNav = mockNavController();
124-
let nestedNav = mockNavController();
125-
let portal = mockNavController();
123+
let rootNav = mockNav();
124+
let nestedNav = mockNav();
125+
let portal = mockNav();
126126
app.setPortal(portal);
127127
app.setRootNav(rootNav);
128128
rootNav.registerChildNav(nestedNav);
@@ -149,8 +149,8 @@ describe('App', () => {
149149
});
150150

151151
it('should pop the overlay in the portal of the root nav', () => {
152-
let nav = mockNavController();
153-
let portal = mockNavController();
152+
let nav = mockNav();
153+
let portal = mockNav();
154154
app.setPortal(portal);
155155
app.setRootNav(nav);
156156

@@ -173,8 +173,8 @@ describe('App', () => {
173173
});
174174

175175
it('should pop the second view in the root nav', () => {
176-
let nav = mockNavController();
177-
let portal = mockNavController();
176+
let nav = mockNav();
177+
let portal = mockNav();
178178
app.setPortal(portal);
179179
app.setRootNav(nav);
180180

@@ -194,8 +194,8 @@ describe('App', () => {
194194
});
195195

196196
it('should exit app when only one view in the root nav', () => {
197-
let nav = mockNavController();
198-
let portal = mockNavController();
197+
let nav = mockNav();
198+
let portal = mockNav();
199199
app.setPortal(portal);
200200
app.setRootNav(nav);
201201

@@ -217,8 +217,8 @@ describe('App', () => {
217217
});
218218

219219
it('should not exit app when only one view in the root nav, but navExitApp config set', () => {
220-
let nav = mockNavController();
221-
let portal = mockNavController();
220+
let nav = mockNav();
221+
let portal = mockNav();
222222
app.setPortal(portal);
223223
app.setRootNav(nav);
224224

@@ -242,8 +242,8 @@ describe('App', () => {
242242
});
243243

244244
it('should not go back if app is not enabled', () => {
245-
let nav = mockNavController();
246-
let portal = mockNavController();
245+
let nav = mockNav();
246+
let portal = mockNav();
247247
app.setPortal(portal);
248248
app.setRootNav(nav);
249249

@@ -276,7 +276,7 @@ describe('App', () => {
276276
describe('getActiveNav', () => {
277277

278278
it('should get active NavController when using tabs with nested nav', () => {
279-
let nav = mockNavController();
279+
let nav = mockNav();
280280
app.setRootNav(nav);
281281

282282
let tabs = mockTabs();
@@ -285,9 +285,9 @@ describe('App', () => {
285285
nav.registerChildNav(tabs);
286286

287287
tab2.setSelected(true);
288-
let nav2 = mockNavController();
289-
let nav3 = mockNavController();
290-
let nav4 = mockNavController();
288+
let nav2 = mockNav();
289+
let nav3 = mockNav();
290+
let nav4 = mockNav();
291291
tab1.registerChildNav(nav4);
292292
tab2.registerChildNav(nav2);
293293
tab2.registerChildNav(nav3);
@@ -296,7 +296,7 @@ describe('App', () => {
296296
});
297297

298298
it('should get active NavController when using tabs, nested in a root nav', () => {
299-
let nav = mockNavController();
299+
let nav = mockNav();
300300
app.setRootNav(nav);
301301

302302
let tabs = mockTabs();
@@ -331,9 +331,9 @@ describe('App', () => {
331331
});
332332

333333
it('should get active NavController when nested 3 deep', () => {
334-
let nav1 = mockNavController();
335-
let nav2 = mockNavController();
336-
let nav3 = mockNavController();
334+
let nav1 = mockNav();
335+
let nav2 = mockNav();
336+
let nav3 = mockNav();
337337
app.setRootNav(nav1);
338338

339339
nav1.registerChildNav(nav2);
@@ -343,22 +343,22 @@ describe('App', () => {
343343
});
344344

345345
it('should get active NavController when nested 2 deep', () => {
346-
let nav1 = mockNavController();
347-
let nav2 = mockNavController();
346+
let nav1 = mockNav();
347+
let nav2 = mockNav();
348348
app.setRootNav(nav1);
349349

350350
nav1.registerChildNav(nav2);
351351
expect(app.getActiveNav()).toBe(nav2);
352352
});
353353

354354
it('should get active NavController when only one nav controller', () => {
355-
let nav = mockNavController();
355+
let nav = mockNav();
356356
app.setRootNav(nav);
357357
expect(app.getActiveNav()).toBe(nav);
358358
});
359359

360360
it('should set/get the root nav controller', () => {
361-
let nav = mockNavController();
361+
let nav = mockNav();
362362
app.setRootNav(nav);
363363
expect(app.getRootNav()).toBe(nav);
364364
});
@@ -443,13 +443,40 @@ describe('App', () => {
443443
var app: App;
444444
var config: Config;
445445
var platform: Platform;
446+
var _cd: any;
447+
448+
function mockNav(): Nav {
449+
return new Nav(null, null, null, config, null, null, null, null, null, null);
450+
}
451+
452+
function mockTabs(): Tabs {
453+
return new Tabs(null, null, null, config, null, null, null);
454+
}
455+
456+
function mockTab(parentTabs: Tabs): Tab {
457+
var tab = new Tab(parentTabs, app, config, null, null, null, null, null, _cd, null);
458+
parentTabs.add(tab);
459+
tab.root = SomePage;
460+
tab.load = function(opts: any, cb: Function) {
461+
cb();
462+
};
463+
return tab;
464+
}
465+
466+
@Component({})
467+
class SomePage {}
446468

447469
beforeEach(() => {
448470
config = new Config();
449471
platform = new Platform();
450472
app = new App(config, platform);
473+
_cd = {
474+
reattach: function(){},
475+
detach: function(){}
476+
};
451477
});
452478

453479
});
454480

481+
455482
}

src/components/app/test/gesture-collision/e2e.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)