summaryrefslogtreecommitdiff
path: root/assets/js/src
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-11-12 14:15:26 -0500
committerFrederic Guillot <fred@kanboard.net>2016-11-12 14:15:26 -0500
commit6225469b91422a4d8521f5693966a8c08f82fbd8 (patch)
treebf570e9a2b073afc36a1623e574290dcdef00ce9 /assets/js/src
parent544da3150a5085cebd8c043698d607efe873e19f (diff)
Add button to close inline popups
Diffstat (limited to 'assets/js/src')
-rw-r--r--assets/js/src/Popover.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/assets/js/src/Popover.js b/assets/js/src/Popover.js
index 4c806278..910c54b0 100644
--- a/assets/js/src/Popover.js
+++ b/assets/js/src/Popover.js
@@ -13,6 +13,10 @@ Kanboard.Popover.prototype.listen = function() {
self.close(e);
});
+ $(document).on("click", "#popover-close-button", function(e) {
+ self.close(e);
+ });
+
$(document).on("click", "#popover-content", function(e) {
e.stopPropagation();
});
@@ -43,7 +47,15 @@ Kanboard.Popover.prototype.open = function(link) {
if (!self.isOpen()) {
$.get(link, function(content) {
- $("body").prepend('<div id="popover-container"><div id="popover-content">' + content + '</div></div>');
+ $("body").prepend(
+ '<div id="popover-container">' +
+ '<div id="popover-content">' +
+ '<div id="popover-content-header"><a href="#" id="popover-close-button"><i class="fa fa-times"></i></a></div>' +
+ content +
+ '</div>' +
+ '</div>'
+ );
+
self.executeOnOpenedListeners();
});
}