Skip to content

Commit 0f558b9

Browse files
authored
feat(dimmer): opacity setting created invalid value on rgb background
When a dimmer already had a rgb background color, the opacity setting for the dimmer was not working because it created an invalid background color value . Reason was because for a pure rgb value the third splitted string array element still had a closing parenthesis, which in turn created an invalid value like rgba(111,111,111),0.1)
1 parent 2518cce commit 0f558b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/definitions/modules/dimmer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,11 @@ $.fn.dimmer = function(parameters) {
408408
var
409409
color = $dimmer.css('background-color'),
410410
colorArray = color.split(','),
411-
isRGB = (colorArray && colorArray.length == 3),
412-
isRGBA = (colorArray && colorArray.length == 4)
411+
isRGB = (colorArray && colorArray.length >= 3)
413412
;
414413
opacity = settings.opacity === 0 ? 0 : settings.opacity || opacity;
415-
if(isRGB || isRGBA) {
414+
if(isRGB) {
415+
colorArray[2] = colorArray[2].replace(')','');
416416
colorArray[3] = opacity + ')';
417417
color = colorArray.join(',');
418418
}

0 commit comments

Comments
 (0)