Pman.Dialog.CoreAutoSavePreview.bjs
authorEdward <edward@roojs.com>
Thu, 8 May 2014 11:04:53 +0000 (19:04 +0800)
committerEdward <edward@roojs.com>
Thu, 8 May 2014 11:04:53 +0000 (19:04 +0800)
Pman.Dialog.CoreAutoSavePreview.js

Pman.Dialog.CoreAutoSavePreview.bjs
Pman.Dialog.CoreAutoSavePreview.js

index 953ac40..d743842 100644 (file)
@@ -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,
index 78f3421..f02e252 100644 (file)
@@ -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");
                     
                 }
             },