Skip to content

Commit

Permalink
feat(dimmer): opacity setting created invalid value on rgb background
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
lubber-de authored Jul 12, 2020
1 parent 2518cce commit 0f558b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/definitions/modules/dimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,11 @@ $.fn.dimmer = function(parameters) {
var
color = $dimmer.css('background-color'),
colorArray = color.split(','),
isRGB = (colorArray && colorArray.length == 3),
isRGBA = (colorArray && colorArray.length == 4)
isRGB = (colorArray && colorArray.length >= 3)
;
opacity = settings.opacity === 0 ? 0 : settings.opacity || opacity;
if(isRGB || isRGBA) {
if(isRGB) {
colorArray[2] = colorArray[2].replace(')','');
colorArray[3] = opacity + ')';
color = colorArray.join(',');
}
Expand Down

0 comments on commit 0f558b9

Please sign in to comment.