Mixins extending handlers

Hi,

I'm having a problem with the new implementation of mixins. My miwin is supposed to extend and handler Changed but it seems to execute only the 'extending' code .

// app.js
{name : "mykind", kind: "enyo.Control", mixins : ["enyo.mymixinSupport"]}

// mymixinSupport.js
enyo.mymixinSupport = {
	name: "enyo.mymixinSupport",
	showingChanged :enyo.inherit(function(sup) { 
		return function(){
			//myMixinStuff
		}	
	})
}
// Reminder of Control.js :
showingChanged: function() {
	this.syncDisplayToShowing();
},
It appears that during runtime, myMixinStuff is executed but syncDisplayToShowing is not. I expected that my mixin would extend and not replace the handler in control.js


* I tried adding this.inherited(arguments) before myMixinStuff like this :
enyo.mymixinSupport = {
	name: "enyo.mymixinSupport",
	showingChanged : enyo.inherit(function(sup) { 
		return function(){
			this.inherited(arguments); // this line is new
			//myMixinStuff
		}	
	})
}
but then i get this warning:
enyo.kind.inherited: unable to find requested super-method from -> showingChanged() in mykind

* The only solution that I've found (which doesn't satisfy me at all) is implementing mymixinSupport like this :
enyo.mymixinSupport = {
	name: "enyo.mymixinSupport",
	showingChanged : enyo.inherit(function(sup) { 
		return function(){
			this.syncDisplayToShowing(); // this line is new
			//myMixinStuff
		}	
	})
}

I am doing something wrong ?

thanks,
Ulysse

Comments

Sign In or Register to comment.