From 47c1bc965254dc539cd8996730fcc00546a32143 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 26 Sep 2015 15:07:33 -0400 Subject: Do not use preventDefault() with .close-popover when there is no popover opened --- assets/js/src/Popover.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'assets/js/src') diff --git a/assets/js/src/Popover.js b/assets/js/src/Popover.js index b978c087..e5bc1c88 100644 --- a/assets/js/src/Popover.js +++ b/assets/js/src/Popover.js @@ -21,11 +21,14 @@ Popover.prototype.open = function(link) { }; Popover.prototype.close = function(e) { - if (e) { - e.preventDefault(); - } + if (this.isOpen()) { + + if (e) { + e.preventDefault(); + } - $('#popover-container').remove(); + $('#popover-container').remove(); + } }; Popover.prototype.onClick = function(e) { -- cgit v1.2.3