diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-09-26 15:07:33 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-09-26 15:07:33 -0400 |
commit | 47c1bc965254dc539cd8996730fcc00546a32143 (patch) | |
tree | 4a786c9a2706d5ed9f083c56106ea913e18eb5f6 /assets/js/src | |
parent | 02106b474710444cb02f87859c8f0dee8c8bd077 (diff) |
Do not use preventDefault() with .close-popover when there is no popover opened
Diffstat (limited to 'assets/js/src')
-rw-r--r-- | assets/js/src/Popover.js | 11 |
1 files changed, 7 insertions, 4 deletions
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) { |