[common] refactoring
This commit is contained in:
parent
6e81f03df5
commit
77d955f5ad
|
@ -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) {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue