I am trying to define a pseudo event with MooTools. It works in Chromium, but not in Firefox. Both browser are the newest stable version. Here is my event:
DOMEvent.definePseudo('ctrl', function(split, fn, args){
if(event.ctrlKey == true) fn.apply(this, args); // this is where Firefox says undefined
});
It should fire, if the crtl key is pressed while clicking an element. This is how I add the event:
this.element.addEvent('click:ctrl', function(event) {
event.stop();
data = this.retrieve('imageData');
this.toggleClass('selected');
if(this.hasClass('selected')) {
gallery.collection[data.id] = data;
} else {
Object.erase(gallery.collection, data.id);
}
});
Any tips or ideas why this error occurs?
My idea is, that I do not pass event
, but I don't have an idea how to do this, since my code is working in Chromium and other browsers.