diff options
Diffstat (limited to 'core/js/jquery.ocdialog.js')
-rw-r--r-- | core/js/jquery.ocdialog.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/js/jquery.ocdialog.js b/core/js/jquery.ocdialog.js index 02bd3069c59..1610d8ac463 100644 --- a/core/js/jquery.ocdialog.js +++ b/core/js/jquery.ocdialog.js @@ -34,6 +34,8 @@ position: 'fixed' }); + this.enterCallback = null; + $(document).on('keydown keyup', function(event) { if ( event.target !== self.$dialog.get(0) && @@ -54,6 +56,11 @@ // Enter if(event.keyCode === 13) { event.stopImmediatePropagation(); + if (self.enterCallback !== null) { + self.enterCallback(); + event.preventDefault(); + return false; + } if(event.type === 'keyup') { event.preventDefault(); return false; @@ -206,6 +213,12 @@ widget: function() { return this.$dialog; }, + setEnterCallback: function(callback) { + this.enterCallback = callback; + }, + unsetEnterCallback: function() { + this.enterCallback = null; + }, close: function() { this._destroyOverlay(); var self = this; |