From: Edward Date: Mon, 3 Sep 2018 04:47:28 +0000 (+0800) Subject: Pman.Dialog.CmsBlog.bjs X-Git-Url: http://git.roojs.org/?p=Pman.Cms;a=commitdiff_plain;h=ca36cbab2532f2f36aca4e4b463372a589bbb1f5 Pman.Dialog.CmsBlog.bjs Pman.Dialog.CmsBlog.js --- diff --git a/Pman.Dialog.CmsBlog.bjs b/Pman.Dialog.CmsBlog.bjs index a1d56864..9096d17b 100644 --- a/Pman.Dialog.CmsBlog.bjs +++ b/Pman.Dialog.CmsBlog.bjs @@ -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", diff --git a/Pman.Dialog.CmsBlog.js b/Pman.Dialog.CmsBlog.js index 5a875aae..5beafe91 100644 --- a/Pman.Dialog.CmsBlog.js +++ b/Pman.Dialog.CmsBlog.js @@ -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) {