Pman.Dialog.CmsBlog.bjs
authorEdward <edward@roojs.com>
Mon, 3 Sep 2018 04:47:28 +0000 (12:47 +0800)
committerEdward <edward@roojs.com>
Mon, 3 Sep 2018 04:47:28 +0000 (12:47 +0800)
Pman.Dialog.CmsBlog.js

Pman.Dialog.CmsBlog.bjs
Pman.Dialog.CmsBlog.js

index a1d5686..9096d17 100644 (file)
@@ -98,7 +98,7 @@
     {
      "listeners" : {
       "expanded" : "function (_self)\n{\n    var id = _this.form.findField('id').getValue() * 1;\n    \n    if(id < 1){\n        Roo.MessageBox.alert('Error', 'Save first');\n        this.collapse();\n        return;\n    }\n    \n    var w = Roo.lib.Dom.getViewWidth();\n    var h = Roo.lib.Dom.getViewHeight();\n    \n    _self.resizeTo.defer(110, _self,[ w-400,  h-350] );\n    \n    _this.panel.region.collapse();\n    \n}",
-      "collapsed" : "function (_self)\n{\n    _this.trform.reset();\n    _this.trform1.reset();\n    _this.trform2.reset();\n    _this.trform3.reset();\n}",
+      "collapsed" : "function (_self)\n{\n    if(_this.trform){\n        _this.trform.reset();\n    }\n    \n    if(_this.trform1){\n        _this.trform1.reset();\n    }\n    \n    if(_this.trform2){\n        _this.trform2.reset();\n    }\n    \n    if(_this.trform3){\n        _this.trform3.reset();\n    }\n    \n}",
       "beforecollapse" : "function (_self)\n{\n    if(!_this.trform || !_this.trform1 || !_this.trform2){\n        return true;\n    }\n    \n    if(\n        !_this.trform.isDirty() &&\n        !_this.trform1.isDirty() &&\n        !_this.trform2.isDirty() &&\n        !_this.trform3.isDirty()\n    ) {\n        return true;\n    }\n    \n    Roo.MessageBox.confirm(\n        \"Confirm\", \n        \"Do you want to save the translation\",\n        function(res) {\n            if(res != 'yes') {\n                _self.collapse(true, true);\n                return true;\n            }\n            \n            return false;\n        }\n    );\n    \n    return false;\n}"
      },
      "collapsedTitle" : "Translations",
index 5a875aa..5beafe9 100644 (file)
@@ -338,10 +338,22 @@ Pman.Dialog.CmsBlog = {
        },
       collapsed : function (_self)
        {
-           _this.trform.reset();
-           _this.trform1.reset();
-           _this.trform2.reset();
-           _this.trform3.reset();
+           if(_this.trform){
+               _this.trform.reset();
+           }
+           
+           if(_this.trform1){
+               _this.trform1.reset();
+           }
+           
+           if(_this.trform2){
+               _this.trform2.reset();
+           }
+           
+           if(_this.trform3){
+               _this.trform3.reset();
+           }
+           
        },
       expanded : function (_self)
        {