Changeset 429 for trunk/plugins


Ignore:
Timestamp:
12/07/05 17:30:49 (14 years ago)
Author:
mokhet
Message:

Fix an error thrown by IE when trying to set a negative width or a negative height

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/Linker/linker.js

    r419 r429  
    384384  this.dialog.onresize = function() 
    385385    { 
    386       options.style.height = ddTree.style.height = (parseInt(dialog.height) - dialog.getElementById('h1').offsetHeight) + 'px'; 
    387       ddTree.style.width  = (parseInt(dialog.width)  - 322 ) + 'px'; 
     386      var h = parseInt(dialog.height) - dialog.getElementById('h1').offsetHeight; 
     387      var w = parseInt(dialog.width)  - 322 ; 
     388      // An error is thrown with IE when trying to set a negative width or a negative height 
     389      // But perhaps a width / height of 0 is not the minimum required we need to set 
     390      if (w<0) w = 0; 
     391      if (h<0) h = 0; 
     392      options.style.height = ddTree.style.height = h + 'px'; 
     393      ddTree.style.width  = w + 'px'; 
    388394    } 
    389395 
Note: See TracChangeset for help on using the changeset viewer.