removed closing of dialog box on an outside click and moved escape key logic to dialog.js
This commit is contained in:
parent
ad017434dc
commit
07149d4083
@ -120,22 +120,6 @@ ClusteringDialog.prototype._createDialog = function() {
|
|||||||
this._elmts.applyCloseButton.click(function() { self._onApplyClose(); });
|
this._elmts.applyCloseButton.click(function() { self._onApplyClose(); });
|
||||||
this._elmts.closeButton.click(function() { self._dismiss(); });
|
this._elmts.closeButton.click(function() { self._dismiss(); });
|
||||||
|
|
||||||
var clickOutside = function(event) {
|
|
||||||
$target = $(event.target);
|
|
||||||
var dist = $target.closest(dialog).length;
|
|
||||||
if(dist == 0 && $(dialog).is(':visible')) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(document).click(clickOutside);
|
|
||||||
|
|
||||||
var escapeKey = function(event) {
|
|
||||||
if (event.keyCode == 27) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(window).keydown(escapeKey);
|
|
||||||
|
|
||||||
// Fill in all the keyers and distances
|
// Fill in all the keyers and distances
|
||||||
$.get("command/core/get-clustering-functions-and-distances")
|
$.get("command/core/get-clustering-functions-and-distances")
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
@ -449,8 +433,6 @@ ClusteringDialog.prototype._export = function() {
|
|||||||
|
|
||||||
ClusteringDialog.prototype._dismiss = function() {
|
ClusteringDialog.prototype._dismiss = function() {
|
||||||
DialogSystem.dismissUntil(this._level - 1);
|
DialogSystem.dismissUntil(this._level - 1);
|
||||||
$(document).off('click');
|
|
||||||
$(window).off('keydown');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ClusteringDialog.prototype._getBaseClusters = function() {
|
ClusteringDialog.prototype._getBaseClusters = function() {
|
||||||
|
@ -67,34 +67,10 @@ ColumnReorderingDialog.prototype._createDialog = function() {
|
|||||||
connectWith: '.column-reordering-dialog-column-container'
|
connectWith: '.column-reordering-dialog-column-container'
|
||||||
})
|
})
|
||||||
.disableSelection();
|
.disableSelection();
|
||||||
|
|
||||||
var justOpened = true;
|
|
||||||
var clickOutside = function(event) {
|
|
||||||
$target = $(event.target);
|
|
||||||
var dialog = $('.dialog-frame');
|
|
||||||
var dist = $target.closest(dialog).length;
|
|
||||||
if(justOpened) {
|
|
||||||
justOpened = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(dist == 0 && $(dialog).is(':visible') && !justOpened) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(document).click(clickOutside);
|
|
||||||
|
|
||||||
var escapeKey = function(event) {
|
|
||||||
if (event.keyCode == 27) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(window).keydown(escapeKey);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ColumnReorderingDialog.prototype._dismiss = function() {
|
ColumnReorderingDialog.prototype._dismiss = function() {
|
||||||
DialogSystem.dismissUntil(this._level - 1);
|
DialogSystem.dismissUntil(this._level - 1);
|
||||||
$(document).off('click');
|
|
||||||
$(window).off('keydown');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ColumnReorderingDialog.prototype._commit = function() {
|
ColumnReorderingDialog.prototype._commit = function() {
|
||||||
|
@ -241,28 +241,6 @@ CustomTabularExporterDialog.prototype._createDialog = function(options) {
|
|||||||
this._elmts.downloadButton.click(function() { self._download(); });
|
this._elmts.downloadButton.click(function() { self._download(); });
|
||||||
this._elmts.downloadPreviewButton.click(function(evt) { self._previewDownload(); });
|
this._elmts.downloadPreviewButton.click(function(evt) { self._previewDownload(); });
|
||||||
|
|
||||||
var justOpened = true;
|
|
||||||
var clickOutside = function(event) {
|
|
||||||
$target = $(event.target);
|
|
||||||
var dialog = $('.dialog-frame');
|
|
||||||
var dist = $target.closest(dialog).length;
|
|
||||||
if(justOpened) {
|
|
||||||
justOpened = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(dist == 0 && $(dialog).is(':visible') && !justOpened) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(document).click(clickOutside);
|
|
||||||
|
|
||||||
var escapeKey = function(event) {
|
|
||||||
if (event.keyCode == 27) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(window).keydown(escapeKey);
|
|
||||||
|
|
||||||
this._configureUIFromOptionCode(options);
|
this._configureUIFromOptionCode(options);
|
||||||
this._updateOptionCode();
|
this._updateOptionCode();
|
||||||
};
|
};
|
||||||
@ -297,8 +275,6 @@ CustomTabularExporterDialog.prototype._configureUIFromOptionCode = function(opti
|
|||||||
|
|
||||||
CustomTabularExporterDialog.prototype._dismiss = function() {
|
CustomTabularExporterDialog.prototype._dismiss = function() {
|
||||||
DialogSystem.dismissUntil(this._level - 1);
|
DialogSystem.dismissUntil(this._level - 1);
|
||||||
$(document).off('click');
|
|
||||||
$(window).off('keydown');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CustomTabularExporterDialog.prototype._previewDownload = function() {
|
CustomTabularExporterDialog.prototype._previewDownload = function() {
|
||||||
|
@ -290,28 +290,6 @@ function SqlExporterDialog(options) {
|
|||||||
this._elmts.downloadButton.click(function() { self._download(); });
|
this._elmts.downloadButton.click(function() { self._download(); });
|
||||||
this._elmts.downloadPreviewButton.click(function(evt) { self._previewDownload(); });
|
this._elmts.downloadPreviewButton.click(function(evt) { self._previewDownload(); });
|
||||||
|
|
||||||
var justOpened = true;
|
|
||||||
var clickOutside = function(event) {
|
|
||||||
$target = $(event.target);
|
|
||||||
var dialog = $('.dialog-frame');
|
|
||||||
var dist = $target.closest(dialog).length;
|
|
||||||
if(justOpened) {
|
|
||||||
justOpened = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(dist == 0 && $(dialog).is(':visible') && !justOpened) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(document).click(clickOutside);
|
|
||||||
|
|
||||||
var escapeKey = function(event) {
|
|
||||||
if (event.keyCode == 27) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(window).keydown(escapeKey);
|
|
||||||
|
|
||||||
this._configureUIFromOptionCode(options);
|
this._configureUIFromOptionCode(options);
|
||||||
this._updateOptionCode();
|
this._updateOptionCode();
|
||||||
};
|
};
|
||||||
@ -332,8 +310,6 @@ function SqlExporterDialog(options) {
|
|||||||
|
|
||||||
SqlExporterDialog.prototype._dismiss = function() {
|
SqlExporterDialog.prototype._dismiss = function() {
|
||||||
DialogSystem.dismissUntil(this._level - 1);
|
DialogSystem.dismissUntil(this._level - 1);
|
||||||
$(document).off('click');
|
|
||||||
$(window).off('keydown');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SqlExporterDialog.prototype._previewDownload = function() {
|
SqlExporterDialog.prototype._previewDownload = function() {
|
||||||
|
@ -64,28 +64,6 @@ TemplatingExporterDialog.prototype._createDialog = function() {
|
|||||||
self._updatePreview();
|
self._updatePreview();
|
||||||
});
|
});
|
||||||
|
|
||||||
var justOpened = true;
|
|
||||||
var clickOutside = function(event) {
|
|
||||||
$target = $(event.target);
|
|
||||||
var dialog = $('.dialog-frame');
|
|
||||||
var dist = $target.closest(dialog).length;
|
|
||||||
if(justOpened) {
|
|
||||||
justOpened = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(dist == 0 && $(dialog).is(':visible') && !justOpened) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(document).click(clickOutside);
|
|
||||||
|
|
||||||
var escapeKey = function(event) {
|
|
||||||
if (event.keyCode == 27) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(window).keydown(escapeKey);
|
|
||||||
|
|
||||||
this._level = DialogSystem.showDialog(dialog);
|
this._level = DialogSystem.showDialog(dialog);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -139,8 +117,6 @@ TemplatingExporterDialog.prototype._scheduleUpdate = function() {
|
|||||||
|
|
||||||
TemplatingExporterDialog.prototype._dismiss = function() {
|
TemplatingExporterDialog.prototype._dismiss = function() {
|
||||||
DialogSystem.dismissUntil(this._level - 1);
|
DialogSystem.dismissUntil(this._level - 1);
|
||||||
$(document).off('click');
|
|
||||||
$(window).off('keydown');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TemplatingExporterDialog.prototype._updatePreview = function() {
|
TemplatingExporterDialog.prototype._updatePreview = function() {
|
||||||
|
@ -57,28 +57,6 @@ ReconDialog.prototype._createDialog = function() {
|
|||||||
this._elmts.reconcileButton.click(function() { self._onOK(); });
|
this._elmts.reconcileButton.click(function() { self._onOK(); });
|
||||||
this._elmts.cancelButton.click(function() { self._dismiss(); });
|
this._elmts.cancelButton.click(function() { self._dismiss(); });
|
||||||
|
|
||||||
var justOpened = true;
|
|
||||||
var clickOutside = function(event) {
|
|
||||||
$target = $(event.target);
|
|
||||||
var dialog = $('.dialog-frame');
|
|
||||||
var dist = $target.closest(dialog).length;
|
|
||||||
if(justOpened) {
|
|
||||||
justOpened = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(dist == 0 && $(dialog).is(':visible') && !justOpened) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(document).click(clickOutside);
|
|
||||||
|
|
||||||
var escapeKey = function(event) {
|
|
||||||
if (event.keyCode == 27) {
|
|
||||||
self._dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(window).keydown(escapeKey);
|
|
||||||
|
|
||||||
this._level = DialogSystem.showDialog(dialog);
|
this._level = DialogSystem.showDialog(dialog);
|
||||||
this._populateDialog();
|
this._populateDialog();
|
||||||
};
|
};
|
||||||
@ -103,8 +81,6 @@ ReconDialog.prototype._dismiss = function() {
|
|||||||
this._serviceRecords = null;
|
this._serviceRecords = null;
|
||||||
|
|
||||||
DialogSystem.dismissUntil(this._level - 1);
|
DialogSystem.dismissUntil(this._level - 1);
|
||||||
$(document).off('click');
|
|
||||||
$(window).off('keydown');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ReconDialog.prototype._cleanDialog = function() {
|
ReconDialog.prototype._cleanDialog = function() {
|
||||||
|
@ -61,6 +61,14 @@ DialogSystem.showDialog = function(elmt, onCancel) {
|
|||||||
|
|
||||||
var level = DialogSystem._layers.length;
|
var level = DialogSystem._layers.length;
|
||||||
|
|
||||||
|
|
||||||
|
var escapeKey = function(event) {
|
||||||
|
if (event.keyCode == 27) {
|
||||||
|
DialogSystem.dismissUntil(level - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(window).keydown(escapeKey);
|
||||||
|
|
||||||
return level;
|
return level;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -90,11 +98,15 @@ DialogSystem.dismissUntil = function(level) {
|
|||||||
for (var i = DialogSystem._layers.length - 1; i >= level; i--) {
|
for (var i = DialogSystem._layers.length - 1; i >= level; i--) {
|
||||||
DialogSystem.dismissLevel(i);
|
DialogSystem.dismissLevel(i);
|
||||||
}
|
}
|
||||||
|
$(window).off('keydown');
|
||||||
DialogSystem._layers = DialogSystem._layers.slice(0, level);
|
DialogSystem._layers = DialogSystem._layers.slice(0, level);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DialogSystem.createDialog = function() {
|
DialogSystem.createDialog = function() {
|
||||||
|
|
||||||
return $('<div></div>').addClass("dialog-frame");
|
return $('<div></div>').addClass("dialog-frame");
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
DialogSystem.showBusy = function(message) {
|
DialogSystem.showBusy = function(message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user