refactor(all): cosmetic changes + app.resize as event emitter

This commit is contained in:
Manu Mtz.-Almeida
2017-02-16 16:02:55 +01:00
parent f577e54f38
commit be0b6a8872
12 changed files with 103 additions and 119 deletions

View File

@ -84,9 +84,7 @@ export function initEvents(s: Slides, plt: Platform): Function {
}
// onresize
unregs.push(plt.onResize(() => {
onResize(s, plt, false);
}));
let resizeObs = plt.resize.subscribe(() => onResize(s, plt, false));
// Next, Prev, Index
if (s.nextButton) {
@ -115,7 +113,8 @@ export function initEvents(s: Slides, plt: Platform): Function {
}
// return a function that removes all of the added listeners
return function() {
return function () {
resizeObs.unsubscribe();
unregs.forEach(unreg => {
unreg();
});