mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -4,6 +4,7 @@ import {ROUTER_BINDINGS, HashLocationStrategy, LocationStrategy, Router} from 'a
|
||||
import {IonicConfig} from '../../config/config';
|
||||
import {IonicPlatform, Platform} from '../../platform/platform';
|
||||
import {ClickBlock} from '../../util/click-block';
|
||||
import {ScrollTo} from '../../animations/scroll-to';
|
||||
import * as dom from '../../util/dom';
|
||||
|
||||
// injectables
|
||||
@@ -53,7 +54,7 @@ export class IonicApp {
|
||||
/**
|
||||
* Bind some global events and publish on the 'app' channel
|
||||
*/
|
||||
bindEvents(events) {
|
||||
bindEvents(platform, events) {
|
||||
window.addEventListener('online', (event) => {
|
||||
events.publish('app:online', event);
|
||||
}, false);
|
||||
@@ -65,6 +66,19 @@ export class IonicApp {
|
||||
window.addEventListener('orientationchange', (event) => {
|
||||
events.publish('app:rotated', event);
|
||||
});
|
||||
|
||||
// When that status taps, we respond
|
||||
window.addEventListener('statusTap', (event) => {
|
||||
// TODO: Make this more better
|
||||
var el = document.elementFromPoint(platform.width() / 2, platform.height() / 2);
|
||||
if(!el) { return; }
|
||||
|
||||
var content = dom.closest(el, 'scroll-content');
|
||||
if(content) {
|
||||
var scrollTo = new ScrollTo(content);
|
||||
scrollTo.start(0, 0, 300, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,7 +190,7 @@ export class IonicApp {
|
||||
*/
|
||||
register(id, component) {
|
||||
if (this.components[id] && this.components[id] !== component) {
|
||||
console.error('Component id "' + id + '" already registered.');
|
||||
//console.error('Component id "' + id + '" already registered.');
|
||||
}
|
||||
this.components[id] = component;
|
||||
}
|
||||
@@ -319,7 +333,7 @@ export function ionicBootstrap(rootComponentType, views, config) {
|
||||
let translate = new Translate();
|
||||
let navRegistry = new NavRegistry(views);
|
||||
|
||||
app.bindEvents(events);
|
||||
app.bindEvents(platform, events);
|
||||
|
||||
// add injectables that will be available to all child components
|
||||
let appBindings = Injector.resolve([
|
||||
|
||||
Reference in New Issue
Block a user