Skip to content

Commit

Permalink
improve code style
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Sep 23, 2016
1 parent 8d10852 commit 807cc1b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ui/public/vislib/lib/dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@ export default function DispatchClass(Private, config) {
if (!label) return;

const dimming = config.get('visualization:dimmingOpacity');
$('[data-label]', element.parentNode)
$(element).parent().find('[data-label]')
.css('opacity', 1)//Opacity 1 is needed to avoid the css application
.not((els, el) => `${$(el).data('label')}` === label)
.not((els, el) => $(el).data('label') === label)
.css('opacity', justifyOpacity(dimming));
}

Expand Down Expand Up @@ -313,9 +313,9 @@ export default function DispatchClass(Private, config) {

function justifyOpacity(opacity) {
const decimalNumber = parseFloat(opacity, 10);
return (0 <= decimalNumber && decimalNumber <= 1) ? decimalNumber : 0.5;
const fallbackOpacity = 0.5;
return (0 <= decimalNumber && decimalNumber <= 1) ? decimalNumber : fallbackOpacity;
}


return Dispatch;
};

0 comments on commit 807cc1b

Please sign in to comment.