From: Edward Date: Thu, 8 May 2014 11:04:53 +0000 (+0800) Subject: Pman.Dialog.CoreAutoSavePreview.bjs X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=8536dafe7b61c398d3de7fe665e27bbc472d4741 Pman.Dialog.CoreAutoSavePreview.bjs Pman.Dialog.CoreAutoSavePreview.js --- diff --git a/Pman.Dialog.CoreAutoSavePreview.bjs b/Pman.Dialog.CoreAutoSavePreview.bjs index 953ac400..d7438423 100644 --- a/Pman.Dialog.CoreAutoSavePreview.bjs +++ b/Pman.Dialog.CoreAutoSavePreview.bjs @@ -7,7 +7,7 @@ "items": [ { "listeners": { - "show": "function (_self)\n{\n if(typeof(_this.data) != 'undefined'){\n _this.grid.footer.onClick('first');\n }\n \n _this.source = '';\n \n _this.viewPanel.setContent(\"Please select a version on the left\");\n \n}" + "show": "function (_self)\n{\n if(typeof(_this.data) != 'undefined'){\n _this.grid.footer.onClick('first');\n }\n \n if (!_this.grid.getSelectionModel().getSelected()) {\n _this.source = '';\n _this.viewPanel.setContent(\"Please select a version on the left\");\n }\n \n \n \n}" }, "background": false, "closable": false, diff --git a/Pman.Dialog.CoreAutoSavePreview.js b/Pman.Dialog.CoreAutoSavePreview.js index 78f34210..f02e252b 100644 --- a/Pman.Dialog.CoreAutoSavePreview.js +++ b/Pman.Dialog.CoreAutoSavePreview.js @@ -37,9 +37,12 @@ Pman.Dialog.CoreAutoSavePreview = { _this.grid.footer.onClick('first'); } - _this.source = ''; + if (!_this.grid.getSelectionModel().getSelected()) { + _this.source = ''; + _this.viewPanel.setContent("Please select a version on the left"); + } + - _this.viewPanel.setContent("Please select a version on the left"); } },