mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
coerce opacity to valid value
This commit is contained in:
parent
b02bbad6c8
commit
8d10852a73
1 changed files with 7 additions and 1 deletions
|
@ -235,7 +235,7 @@ export default function DispatchClass(Private, config) {
|
|||
$('[data-label]', element.parentNode)
|
||||
.css('opacity', 1)//Opacity 1 is needed to avoid the css application
|
||||
.not((els, el) => `${$(el).data('label')}` === label)
|
||||
.css('opacity', dimming);
|
||||
.css('opacity', justifyOpacity(dimming));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -311,5 +311,11 @@ export default function DispatchClass(Private, config) {
|
|||
}
|
||||
|
||||
|
||||
function justifyOpacity(opacity) {
|
||||
const decimalNumber = parseFloat(opacity, 10);
|
||||
return (0 <= decimalNumber && decimalNumber <= 1) ? decimalNumber : 0.5;
|
||||
}
|
||||
|
||||
|
||||
return Dispatch;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue