1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Minot fixes to the addnew plugin.

This commit is contained in:
Thomas Tanghus 2013-05-21 23:40:37 +02:00
parent e8c7047869
commit 17dfcbe99c

View File

@ -61,15 +61,21 @@
&& self.$ul.find($(event.target)).length === 0) {
//console.log('outside', $(event.target), self.$ul.find(event.target));
self.close();
self._trigger('cancel');
return;
}
// Escape
if(event.keyCode && event.keyCode === 27 && self.options.closeOnEscape) {
self.close();
self._trigger('cancel');
return false;
}
});
this.element.on('keydown keyup', function(event) {
// Enter
if(event.keyCode && event.keyCode === 13) {
event.stopPropagation();
event.stopImmediatePropagation();
if(event.type === 'keyup') {
event.preventDefault();