From a385ee5f627a297e305f88b7bd210276df66d20f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Schr=C3=B6der?= Date: Mon, 8 Feb 2016 12:04:27 +0100 Subject: [PATCH] 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. --- src/definitions/modules/dimmer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index c68d90479..d972cec68 100644 --- a/src/definitions/modules/dimmer.js +++ b/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(','); }