Add button to close inline popups

This commit is contained in:
Frederic Guillot
2016-11-12 14:15:26 -05:00
parent 544da3150a
commit 6225469b91
5 changed files with 32 additions and 5 deletions

View File

@@ -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();
});
}