Skip to content

Commit

Permalink
fix modal/dimmer inverted bug Semantic-Org#3192
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
larsbo committed Feb 8, 2016
1 parent 7599cf8 commit a385ee5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/definitions/modules/dimmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(',');
}
Expand Down

0 comments on commit a385ee5

Please sign in to comment.