function MakeDrawable(containerID){
this.container = (document.getElementById(containerID) || document.body);
this.onCreateElement = null;//Evento externo
this.container.onmouseup = function(e){
e.preventDefault();
var hash = {Nombre:"Hola", Apellido: "Mundo"};
//Quiero llamar a mi evento externo
this.onCreateElement(hash);
}
}
//Implementacion
var drawableContainer = new MakeDrawable("qa");
drawableContainer.onCreateElement = function(hash){
alert(JSON.stringify(hash));
};
Thank you in advance for your time!
The question of the title is that it is half confused, but the code explains my doubt well.
My idea with this is to make the implementation and use the event by bindeandole a function created by me, that it receives an argument. The thing is that it is not working, I do not know how to access from the container mouseup to the onCreateElement event that I have in my MakeDrawable class, keeping the execution thread of each < em> new what about the class.
Thank you very much!
Edit: Ignore the semicolon or keys because the code was cut to have the specific case. I'm interested in the part of the call.