This project is archived and is in readonly mode.

#320 ✓resolved
Aicke Schulz

Mask improvement for document.body

Reported by Aicke Schulz | July 6th, 2010 @ 10:19 AM | in 1.3.1.1

In some conditions, when html/body size is miscalculated, the mask for document.body do not cover the whole page (when scrolling to the side the mask ends in front of the border).

I've analyzed the following code part:

if (this.target == document.body) {
 var win = window.getSize();
 if (dim.totalHeight < win.y) dim.totalHeight = win.y;
 if (dim.totalWidth < win.x) dim.totalWidth = win.x;
}

My suggestion for changes is:

if (this.target == document.body) {
 var win = window.getScrollSize();
 if (dim.totalHeight < win.y) dim.totalHeight = win.y;
 if (dim.totalWidth < win.x) dim.totalWidth = win.x;
 this.element.setStyles({left: 0, top: 0});
}

I don't think this will harm the general behavior, because of the conditional code but makes the mask more robust.

Comments and changes to this ticket

  • Arian

    Arian September 20th, 2010 @ 05:01 PM

    • Milestone set to 1.2.5.1
    • State changed from “new” to “open”
    • Assigned user set to “Aaron Newton”
    • Milestone order changed from “197496” to “0”
  • Ryan Florence

    Ryan Florence September 21st, 2010 @ 07:47 AM

    Shouldn't the width just become 100% instead of checking the window size when the mask is on the body?

  • Aaron Newton

    Aaron Newton September 21st, 2010 @ 07:23 PM

    • Milestone changed from 1.2.5.1 to 1.2.5.2
    • Milestone order changed from “31” to “0”

    The problem is that the document.body isn't always 100% high.

    The scrollsize change seems reasonable though. We'd need to test it a lot.

  • Tim Wienk

    Tim Wienk November 5th, 2010 @ 07:29 AM

    • State changed from “open” to “resolved”
    • Milestone changed from 1.2.5.2 to 1.3.1.1
    • Tag changed from dimensions, getscrollsize, mask, more, resize to body, dimensions, getscrollsize, mask, resize, spinner, window
    • Assigned user changed from “Aaron Newton” to “Arian”
    • Milestone order changed from “34” to “0”

    This seems to be already resolved:
    https://github.com/mootools/mootools-more/commit/91e154d3

    We should check if the suggested line this.element.setStyles({left: 0, top: 0}); makes any additional difference.

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