beCodeMyFriend / Cuore.js

Other
34 stars 13 forks source link

problem with method 'init' with 2 or more inheritance levels #11

Closed elmendalerenda closed 12 years ago

elmendalerenda commented 12 years ago

When creating a component that inherits Components.Input, the new component won't create the renderer properly. Thats because if a child doesnt have init method, the new child is not able to call its grandfather init method To solve it, add something like

    if (!hasOwn.call(Child.prototype, 'init') && Child.parent) {
            Child.parent.init.apply(this, arguments);
    }

into Cuore.Class.js, into Child function

elmendalerenda commented 12 years ago

I have tested it and it is working in this last version