Reputation: 7
I would like to override one method
onMouseUp:function(evt){
if(evt.target===this.domNode||!this._highlighted_option){
return;
}else{
if(evt.target==this.previousButton){
this.onPage(-1);
}else{
if(evt.target==this.nextButton){
this.onPage(1);
}else{
var tgt=evt.target;
while(!tgt.item){
tgt=tgt.parentNode;
}
in my JavaScript file.
How can I do that?
Upvotes: 0
Views: 673
Reputation: 13843
Literally, overwrite it using the same object and same method name.
var object = {
'method': function() {
// original script
}
};
// your script
object.method = function() {
// your script, original gets overwritten
};
EDIT
After a quick google and clicking the first result, I found a very simular thread which is probably more accurate for your... "problem": Dojo: how to use own onMove event (overwrite)
Upvotes: 1