diff --git a/main/webapp/modules/core/scripts/dialogs/sql-exporter-dialog.js b/main/webapp/modules/core/scripts/dialogs/sql-exporter-dialog.js index c8e7399ab..acfddddc3 100755 --- a/main/webapp/modules/core/scripts/dialogs/sql-exporter-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/sql-exporter-dialog.js @@ -289,7 +289,6 @@ function SqlExporterDialog(options) { this._elmts.cancelButton.click(function() { self._dismiss(); }); this._elmts.downloadButton.click(function() { self._download(); }); this._elmts.downloadPreviewButton.click(function(evt) { self._previewDownload(); }); - this._configureUIFromOptionCode(options); this._updateOptionCode(); }; diff --git a/main/webapp/modules/core/scripts/util/dialog.js b/main/webapp/modules/core/scripts/util/dialog.js index c76e4df94..8b3c6e339 100644 --- a/main/webapp/modules/core/scripts/util/dialog.js +++ b/main/webapp/modules/core/scripts/util/dialog.js @@ -35,6 +35,13 @@ DialogSystem = { _layers: [] }; +var escapeKey = function(event) { + var level = DialogSystem._layers.length; + if (event.keyCode == 27) { + DialogSystem.dismissUntil(level - 1); + } +} + DialogSystem.showDialog = function(elmt, onCancel) { var overlay = $('
 
') .addClass("dialog-overlay") @@ -61,6 +68,8 @@ DialogSystem.showDialog = function(elmt, onCancel) { var level = DialogSystem._layers.length; + $(window).keydown(escapeKey); + return level; }; @@ -90,6 +99,7 @@ DialogSystem.dismissUntil = function(level) { for (var i = DialogSystem._layers.length - 1; i >= level; i--) { DialogSystem.dismissLevel(i); } + $(window).off('keydown', escapeKey); DialogSystem._layers = DialogSystem._layers.slice(0, level); };