This project is archived and is in readonly mode.

#204 ✓hold
philthathril

Mask resize event not implemented

Reported by philthathril | December 3rd, 2009 @ 05:30 PM | in 1.2.4.3

In the Mask utility, if I implement the "resize" method, it's only called during the initial show of the mask. If I resize the browser window (which is supposed to call the resize method again), my implemented resize method does not get called - the event is defined in the default "show" method.

Mask.implement({
    resize: function (x,y) {
        alert('resizing');
        var opt = {
            styles: ['padding', 'border']
        };
        if (this.options.maskMargins) opt.styles.push('margin');
        var dim = this.target.getComputedSize(opt);
        var win = window.getScrollSize(); // changed from getSize()
        if (this.target == document.body) {
            if (dim.totalHeight < win.y) dim.totalHeight = win.y;
            if (dim.totalWidth < win.x) dim.totalWidth = win.x;
        }
        this.element.setStyles({
            width: $pick(x, dim.totalWidth, dim.x),
            height: $pick(y, dim.totalHeight, dim.y)
        });
        return this;
    }
});

When the mask first shows, I get the alert "resizing". If I actually resize the window, I get no alert.

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

Pages