Merge remote-tracking branch 'origin/master'

This commit is contained in:
Adam Bradley
2015-10-01 15:49:02 -05:00
23 changed files with 655 additions and 117 deletions

View File

@@ -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([