diff --git a/apps/common/mobile/utils/notifications.js b/apps/common/mobile/utils/notifications.js index f43e7080c..d86a60c75 100644 --- a/apps/common/mobile/utils/notifications.js +++ b/apps/common/mobile/utils/notifications.js @@ -5,8 +5,15 @@ export default class Notifications { } on(event, callback) { - !this._events[event] && (this._events[event] = []); - this._events[event].push(callback); + const addevent = (e, c) => { + !this._events[e] && (this._events[e] = []); + this._events[e].push(c); + }; + + if ( typeof(event) == 'object' ) + for (const i in event) + addevent(i, event[i]) + else addevent(event, callback); } off(event, callback) { diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index ad66e92e6..1985d10d9 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -134,6 +134,8 @@ class MainController extends Component { const onDocumentContentReady = () => { Common.Gateway.documentReady(); f7.emit('resize'); + + Common.Notifications.trigger('document:ready'); }; const _process_array = (array, fn) => {