Yeah you can just access the parent function from the Extended Class. Thats the intended behavior. I mean who's the parent of who if you mix 2 classes that have the same method names? I'm confused now.
-- Fábio Miranda Costa Solucione Sistemas Engenheiro de interfaces On Fri, Apr 16, 2010 at 3:56 PM, Bogdan Gusiev <[email protected]> wrote: > > "if (this.parent)" doesn't work for me. It is always defined. > > > I will try to describe the whole situation: > > I have two mixins for the Widget class: > Animated is responding for animation. > Stateful is doing widget state control. > > Both of them have show() and hide() methods. > But these mixins are independent from each other and I want to be able > to use them one by one and together. > > In addition, it's sad that 'parent' is inaccessible in class mixed up > with 'Implements'. > > > On Apr 16, 8:30 pm, Fábio M. Costa <[email protected]> wrote: > > Could you explain why you need this? > > It makes little sense to me. > > Anyway you can do: > > > > if (this.parent) this.parent(); > > > > -- > > Fábio Miranda Costa > > Solucione Sistemas > > Engenheiro de interfaces > > > > > > > > On Fri, Apr 16, 2010 at 1:07 PM, Bogdan Gusiev <[email protected]> > wrote: > > > Good morning JS geeks, > > > > > Can somebody advice is there a way to check if class method exists in > > > Extended class? > > > > > Like: > > > > > new Class({ > > > > > Extends: UnknownClass, > > > > > show: function() { > > > if (this.hasParent()) { > > > this.parent(); > > > } > > > this.doSomethingElse(); > > > } > > > > > }); > > > > > -- > > > Subscription settings: > > >http://groups.google.com/group/mootools-users/subscribe?hl=en >
