diff --git a/apps/spreadsheeteditor/main/app/view/ScaleDialog.js b/apps/spreadsheeteditor/main/app/view/ScaleDialog.js index c49e2704c..3b5f71c68 100644 --- a/apps/spreadsheeteditor/main/app/view/ScaleDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ScaleDialog.js @@ -169,10 +169,10 @@ define([ }, _handleInput: function(state) { - if (this.options.handler) { - this.options.handler.call(this, state, (state == 'ok') ? this.getSettings() : undefined); + if (this.options.handler && state === 'ok') { + this.options.handler.call(this, 'ok', this.getSettings()); } - this.close(); + this.close(state); }, onBtnClick: function(event) { @@ -316,6 +316,13 @@ define([ } }, + close: function(state) { + if (this.options.handler && state !== 'ok') { + this.options.handler.call(this, 'cancel', undefined); + } + Common.UI.Window.prototype.close.call(this); + }, + textTitle: 'Scale Settings', textWidth: 'Width', textHeight: 'Height',