Fixing series quick switch hovering issue

This commit is contained in:
Bruno Alves de Faria committed 2018-03-26 08:36:48 -03:00
1 parent af611109c0
commit c1d500a92b
3 files changed
+17 -9

No files matched your search

@@ -114,9 +114,21 @@ Template.seriesQuickSwitch.events({
'mouseenter .series-switch, rescale .series-switch'(event, instance) {
// Control the width of the series browser
const $switch = $(event.currentTarget);
const browserWidth = $switch.offset().left + $switch.outerWidth();
const $seriesBrowser = $switch.find('.series-browser');
$seriesBrowser.width(browserWidth - (browserWidth % 237));
const $seriesQuickSwitch = $switch.closest('.series-quick-switch');
const isRight = $seriesQuickSwitch.hasClass('right');
const switchOffsetLeft = $switch.offset().left;
const switchOuterWidth = $switch.outerWidth();
let browserWidth;
if (isRight) {
browserWidth = $(window).width() - switchOffsetLeft;
} else {
browserWidth = switchOffsetLeft + switchOuterWidth;
}
$seriesBrowser.width(browserWidth - (browserWidth % 240));
const $quickSwitch = instance.$('.series-quick-switch');
if ($quickSwitch.is(':hover')) {