popup; bin esc key only if closable
This commit is contained in:
parent
9ca7e6bb92
commit
a432563195
1 changed files with 3 additions and 7 deletions
|
|
@ -15,9 +15,11 @@ module.exports = {
|
|||
closer.click(function(){
|
||||
popup.close()
|
||||
})
|
||||
$(document).on('keydown.popup', function(e){
|
||||
if (e.keyCode==27) popup.close()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
popup.close = function(){
|
||||
$(document).off('.popup')
|
||||
popup.remove()
|
||||
|
|
@ -26,12 +28,6 @@ module.exports = {
|
|||
popup.find('.popup-content').append(content)
|
||||
$('body').append(popup)
|
||||
|
||||
$(document).on('keydown.popup', function(e){
|
||||
if (e.keyCode==27) popup.close()
|
||||
})
|
||||
|
||||
|
||||
|
||||
return popup
|
||||
},
|
||||
loading: function(title){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue