Commit 3283386a authored by Luke Bennett's avatar Luke Bennett

use jquery object in togglePopover

parent 8d43fe4e
...@@ -2,12 +2,13 @@ import $ from 'jquery'; ...@@ -2,12 +2,13 @@ import $ from 'jquery';
import _ from 'underscore'; import _ from 'underscore';
export function togglePopover(show) { export function togglePopover(show) {
const isAlreadyShown = this.hasClass('js-popover-show'); const $popover = $(this);
const isAlreadyShown = $popover.hasClass('js-popover-show');
if ((show && isAlreadyShown) || (!show && !isAlreadyShown)) { if ((show && isAlreadyShown) || (!show && !isAlreadyShown)) {
return false; return false;
} }
this.popover(show ? 'show' : 'hide'); $popover.popover(show ? 'show' : 'hide');
this.toggleClass('disable-animation js-popover-show', show); $popover.toggleClass('disable-animation js-popover-show', show);
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment