use jquery object in togglePopover
This commit is contained in:
parent
8d43fe4efe
commit
3283386a1e
1 changed files with 4 additions and 3 deletions
|
@ -2,12 +2,13 @@ import $ from 'jquery';
|
|||
import _ from 'underscore';
|
||||
|
||||
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)) {
|
||||
return false;
|
||||
}
|
||||
this.popover(show ? 'show' : 'hide');
|
||||
this.toggleClass('disable-animation js-popover-show', show);
|
||||
$popover.popover(show ? 'show' : 'hide');
|
||||
$popover.toggleClass('disable-animation js-popover-show', show);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue