kavinithiy / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 0 forks source link

Resize window sometime crash #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  if element has functions resizing window crash in runtimeStyle

Function : addResize

for (i in elements) {
        var element = elements[i];
        var fixedWidth = (parseInt(element.runtimeStyle.width) == 
getFixedWidth(element, element.currentStyle.minWidth));
        if (wider && fixedWidth) element.runtimeStyle.width = "";
        if (wider == fixedWidth) resizeWidth(element);
      }

should be changed to:
for (var i=0; i< elements.length; i++) {
        var element = elements[i];
        var fixedWidth = (parseInt(element.runtimeStyle.width) == 
getFixedWidth(element, element.currentStyle.minWidth));
        if (wider && fixedWidth) element.runtimeStyle.width = "";
        if (wider == fixedWidth) resizeWidth(element);
      }

Inform me if patch file needed.

Original issue reported on code.google.com by scham...@gmail.com on 27 Mar 2009 at 12:43

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sorry for flame, but most correct way is probably:

for(var i in elements) {
        var element = elements[i];
        if(typeof(element) == 'function')
            continue;
        var fixedWidth = (parseInt(element.runtimeStyle.width) == 
getFixedWidth(element, element.currentStyle.minWidth));
        if (wider && fixedWidth) element.runtimeStyle.width = "";
        if (wider == fixedWidth) resizeWidth(element);
      }

Original comment by scham...@gmail.com on 27 Mar 2009 at 1:09

GoogleCodeExporter commented 9 years ago
Can you post a test case please? I won't include any code without a test case 
to test 
against.

Original comment by dean.edw...@gmail.com on 11 Feb 2010 at 6:18