chg: [generic_popover] Pressing <ESC> destroy the popover

pull/4024/head
mokaddem 2019-01-18 09:29:34 +01:00
parent 593f58ad09
commit 3d69620148
1 changed files with 7 additions and 1 deletions

View File

@ -1439,7 +1439,13 @@ function openPopover(clicked, data) {
var popoverTitle = popover.find('h3.popover-title');
popoverTitle.html(title + closeButtonHtml);
})
.popover('show');
.popover('show')
.on('keydown.volatilePopover', function(e) {
if(e.keyCode == 27) { // ESC
$(this).popover('destroy');
$(this).off('keydown.volatilePopover');
}
});
} else {
// $clicked.popover('show');
}