Whenever I click a link that's in the child frame, (of class="modalframe-exclude") it shrinks the frame by 20px or so.

Comments

markus_petrux’s picture

Status: Active » Fixed

I have also observed this behavior at some point. This is probably because the resize event handler fires, and the calculations of the inner document size vary, and that leads to resizing the modal frame.

As a support request, that's all I can say.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

hefox’s picture

Category: support » bug
Status: Closed (fixed) » Active

I'm experiencing something similiar this also.

I don't see any why this isn't an active bug report, so marking it as such (Is it a bug in the jquery library?). It can render the modal frame bit unfriendly/unusable as it get's quite skinny after it happens many times.

In my case I have a view and the exposed filter apply button is what is causing the re-size. Skinnification happens despite Ther happens despite no difference in the contents of the page.

This #832082: Enhance the behavior of the autoFit option may be related.

hefox’s picture

Status: Active » Needs review
StatusFileSize
new738 bytes

Something I can't test atm cause my small screen, but this wasn't happening when someone with a big monitor full screened it.

Looking at the calculations, it's resizing with a 15 pixel loss.

My scrollbar appears to be about 15 pixels wide.

Conclusion: The width calculations for resize based on iframe size don't include the scrollbar width, so keep decreasing by scrollbar width each resize despite the size not changing.

Patch attached seems to work. Briefly looked into figuring out how to calculated scroll-bar size, but couldn't find any nice, so figured instead just removing scroll-bar during calculations would be easier. Think the selector needs to be different, but js is one of my weakpoints :(.

markus_petrux’s picture

May we get some information about the behavior of this fix for different browsers?

hefox’s picture

Status: Needs review » Needs work
StatusFileSize
new783 bytes

Here's a patch that works in firefox and chrome (previous one not working in chrome). No info on IE.

In safari it removes the scrollbar till playing around with stuff (like selecting text and fakescrolling down). (managing to trigger some sort of recalculation?). Any advice?

hefox’s picture

Don't have the wakefullness to see if it can help, but seutje suggested this to determine the size of the scrollbar. Though, how to determine if somehting has a scrollbar mm >.O

http://jsbin.com/iboxa4/edit

(function($) {
  $.browser.scrollbar = (function(w) {
    var d = w.document, c = d.compatMode,
    r = c && /CSS/.test(c) ? d.documentElement : d.body;
    if (typeof w.innerWidth == 'number') {
      return {
        'horizontal': w.innerHeight > r.clientHeight,
        'vertical' : w.innerWidth > r.clientWidth
      };
    }
    return {
      'horizontal': r.scrollWidth > r.clientWidth,
      'vertical': r.scrollHeight > r.clientHeight
    };
  })(window);
  
  $.browser.scrollbar.size = (function() {
    var $outer = $('<div style="width: 50px; overflow: scroll; position: absolute; left: -9999px;"></div>').appendTo('body'),
        $inner = $('<div></div>').appendTo($outer);
    return $outer.width() - $inner.width();
  })();
  
  alert($.browser.scrollbar.vertical);
  alert($.browser.scrollbar.size);
})(jQuery);
seutje’s picture

actually, that first part is to determine if there are scrollbars present (but only checks on load, doesn't update the values)

so $.browser.scrollbar.vertical would return true if there is (or was) a vertical scrollbar on load, $.browser.scrollbar.horizontal will do the same for horizontal scrollbar

$.browser.scrollbar.size would always return the size of the scrollbar in pixels, even if there aren't any scrollbars present. It simply creates 2 divs inside each other (positioned off-screen), slaps a scrollbar on the outer one and check the difference in width

oops: I just realized I totally forgot to remove those divs from the DOM, update -> http://jsbin.com/iboxa4/3

(function($) {
  $.browser.scrollbar = (function(w) {
    var d = w.document, c = d.compatMode,
    r = c && /CSS/.test(c) ? d.documentElement : d.body;
    if (typeof w.innerWidth == 'number') {
      return {
        'horizontal': w.innerHeight > r.clientHeight,
        'vertical' : w.innerWidth > r.clientWidth
      };
    }
    return {
      'horizontal': r.scrollWidth > r.clientWidth,
      'vertical': r.scrollHeight > r.clientHeight
    };
  })(window);
  
  $.browser.scrollbar.size = (function() {
    var $outer = $('<div style="width: 50px; overflow: scroll; position: absolute; left: -9999px;"></div>').appendTo('body'),
        $inner = $('<div></div>').appendTo($outer),
        diff = $outer.width() - $inner.width();
    $outer.remove();
    return diff;
  })();
})(jQuery);​
Michsk’s picture

last submitted patch also fixes: http://drupal.org/node/947076

//edit: not completely, the first time it does increase the modals size. The second time posting a new status/new ajax call does not increase it any more.

Michsk’s picture

Anything been done on this one?

dsnopek’s picture

It took me a while to recreate this one, but I can confirm that the window width gets slightly smaller (like 1-2px) on each link click on Chrome 29.0.1547.76 and Firefox 24.0. Unfortunately, the patch in #6 has no effect. :-/ However, the fact that it's only 1-2px in my case makes it relatively harmless...

Can anyone give me the browser and version where your see the huge shrinking?

dsnopek’s picture

Issue summary: View changes
Status: Needs work » Fixed

Actually, you know what - this patch is totally harmless and if it fixes this problem for anyone in any browser/version ever, it's probably a good idea to commit it. :-) Committed in 195f0da, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.