Browse Source

fix modal/dimmer inverted bug #3192

During the second dimmer run the color was extracted from the DOM. At
least Firefox automatically converts RGBA to RGB if possible which
caused the bug.

With this fix the dimmer module can now detect both RGB and RGBA colors.
pull/3665/head
Lars Schröder 9 years ago
parent
commit
a385ee5f62
1 changed files with 2 additions and 1 deletions
  1. 3
      src/definitions/modules/dimmer.js

3
src/definitions/modules/dimmer.js

@ -383,10 +383,11 @@ $.fn.dimmer = function(parameters) {
var
color = $dimmer.css('background-color'),
colorArray = color.split(','),
isRGB = (colorArray && colorArray.length == 3),
isRGBA = (colorArray && colorArray.length == 4)
;
opacity = settings.opacity === 0 ? 0 : settings.opacity || opacity;
if(isRGBA) {
if(isRGB || isRGBA) {
colorArray[3] = opacity + ')';
color = colorArray.join(',');
}

Loading…
Cancel
Save