koken / issues

Public issue tracker for Koken http://koken.me
8 stars 0 forks source link

this.channel throw exception in Koken.extend #25

Closed zorn-v closed 7 years ago

zorn-v commented 8 years ago

I want to extend admin interface via plugin. I found a good way through console/plugin.js but problem to change templates. In my first plugin (export) I just append element to body with position absolute. Click event on that element fire sync method. Not as I would like but it'll do. But in my future plugin I need a separate page with settings (standard plugin "setup" not suitable). A good way to do this is channels, but if I call this.channel({id: 'test', name: 'test', title: 'test'}); I got __k.interfaces.app.observers.channels is undefined (koken-core.js:1451) Workaround is setTimeout but I think it ugly hack.

To reproduce just create console/plugin.js in any plugin with

Koken.extend(function () {
    this.channel({
        id: 'test',
        name: 'Test',
        title: 'Test'
    });
});

and clear system cache

MikeCostello commented 7 years ago

This might be better solved on the community forums or Koken help center. If you're having a timing related issue consider using an event handler triggered by one of Koken's native events.