This project is archived and is in readonly mode.

#504 ✓resolved
Romo

Event not available in Mask onClick

Reported by Romo | February 3rd, 2011 @ 10:17 AM | in 1.3.1.1

in the onClick handler for the Mask class, the original click-event isn't passed through. However, one may need this to determine where on the mask (i.e. left or right hand side of the mask) was clicked.

Solution: replace Mask.render with the following code:

render: function() {

    this.element = new Element('div', {
        'class': this.options['class'],
        id: this.options.id || 'mask-' + $time(),
        styles: $merge(this.options.style, {
            display: 'none'
        }),
        events: {
            click: function(e){
                this.fireEvent('click', e);
                if (this.options.hideOnClick) this.hide();
            }.bind(this)
        }
    });
    this.hidden = true;
},

Only thing changed is the click handler for the mask. It now fetches the Event, and inserts it in the call to fireEvent.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions

People watching this ticket

Pages