diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index 2b4af6915..9567d2efe 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -244,6 +244,7 @@ "core-dialogs/sql-exporter": "SQL Exporter", "core-dialogs/custom-tab-exp": "Custom Tabular Exporter", "core-dialogs/select-columns-dialog": "Select columns", + "core-dialogs/unstar-expression": "Unstar expression?", "core-dialogs/content": "Content", "core-dialogs/download": "Download", "core-dialogs/upload": "Upload", diff --git a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js index e88f16c9c..7618ef0f7 100644 --- a/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js +++ b/main/webapp/modules/core/scripts/dialogs/expression-preview-dialog.js @@ -350,15 +350,30 @@ ExpressionPreviewDialog.Widget.prototype._renderStarredExpressions = function(da var o = Scripting.parse(entry.code); $(''+$.i18n('core-dialogs/remove')+'').appendTo(tr.insertCell(0)).click(function() { - Refine.postCSRF( - "command/core/toggle-starred-expression", - { expression: entry.code, returnList: true }, - function(data) { - self._renderStarredExpressions(data); - self._renderExpressionHistoryTab(); - }, - "json" - ); + var removeExpression = DialogSystem.createDialog(); + removeExpression.width("250px"); + var removeExpressionHead = $('
').addClass("dialog-header").text($.i18n('core-dialogs/unstar-expression')) + .appendTo(removeExpression); + var removeExpressionFooter = $('').addClass("dialog-footer").appendTo(removeExpression); + + $('').html($.i18n('core-buttons/ok')).click(function() { + Refine.postCSRF( + "command/core/toggle-starred-expression", + { expression: entry.code, returnList: true }, + function(data) { + self._renderStarredExpressions(data); + self._renderExpressionHistoryTab(); + }, + "json" + ); + DialogSystem.dismissUntil(DialogSystem._layers.length - 1); + }).appendTo(removeExpressionFooter); + + $('').text($.i18n('core-buttons/cancel')).click(function() { + DialogSystem.dismissUntil(DialogSystem._layers.length - 1); + }).appendTo(removeExpressionFooter); + + this._level = DialogSystem.showDialog(removeExpression); }); $('Reuse').appendTo(tr.insertCell(1)).click(function() {