Prototype: Make setStyle() with opacity: 0 in Internet Explorer work correctly. [Thomas Fuchs]

This commit is contained in:
Thomas Fuchs 2007-01-19 18:01:43 +00:00
parent 84901897c8
commit 8ea007df28
3 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,7 @@
*SVN*
* Make setStyle() with opacity: 0 in Internet Explorer work correctly. [Thomas Fuchs]
* Form.Element.activate shouldn't raise an exception when the form or field is hidden. [sam]
* Remove support for "throw $continue" in Enumerable. Use "return" instead. [sam]

View File

@ -333,7 +333,7 @@ Element.Methods = {
!/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : 1.0;
if(/MSIE/.test(navigator.userAgent) && !window.opera)
element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'');
} else if(value == '') {
} else if(value === '') {
if(/MSIE/.test(navigator.userAgent) && !window.opera)
element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'');
} else {

View File

@ -610,9 +610,11 @@
$('style_test_3').setStyle({ opacity: 0.5 });
assertEqual(0.5, $('style_test_3').getStyle('opacity'));
// should remove opacity
$('style_test_3').setStyle({ opacity: '' });
assertEqual(1, $('style_test_3').getStyle('opacity'));
$('style_test_3').setStyle({ opacity: 0 });
assertEqual(0, $('style_test_3').getStyle('opacity'));
}},
testElementGetStyle: function() { with(this) {