Kaynağa Gözat

修复组件隐藏的时候,组件高度为0的问题

unknown 5 yıl önce
ebeveyn
işleme
f9866cb543

+ 2 - 2
o2web/package.json

@@ -34,10 +34,10 @@
     "gulp-if": "^2.0.2",
     "gulp-if": "^2.0.2",
     "gulp-rename": "^1.4.0",
     "gulp-rename": "^1.4.0",
     "gulp-sftp": "^0.1.5",
     "gulp-sftp": "^0.1.5",
+    "gulp-sftp-up4": "^0.1.8",
     "gulp-tm-asset-rev": "0.0.16",
     "gulp-tm-asset-rev": "0.0.16",
     "gulp-tm-uglify": "3.0.1",
     "gulp-tm-uglify": "3.0.1",
     "merge-stream": "^1.0.1",
     "merge-stream": "^1.0.1",
-    "minimist": "^1.2.0",
-    "gulp-sftp-up4": "^0.1.8"
+    "minimist": "^1.2.0"
   }
   }
 }
 }

+ 1 - 1
o2web/source/x_component_cms_Xform/ModuleImplements.js

@@ -30,7 +30,7 @@ if( !MWF.CMS$Input_Process ){
                 }
                 }
             }
             }
             if (this.json.inputStyles) if (this.node.getFirst()) this.node.getFirst().setStyles(this.json.inputStyles);
             if (this.json.inputStyles) if (this.node.getFirst()) this.node.getFirst().setStyles(this.json.inputStyles);
-            if (this.iconNode){
+            if (this.iconNode && this.iconNode.offsetParent !== null  ){
                 var size = this.node.getSize();
                 var size = this.node.getSize();
                 this.iconNode.setStyle("height", ""+size.y+"px");
                 this.iconNode.setStyle("height", ""+size.y+"px");
             }
             }

+ 1 - 1
o2web/source/x_component_cms_Xform/Readerfield.js

@@ -602,7 +602,7 @@ MWF.xApplication.cms.Xform.Readerfield = MWF.CMSReaderfield =  new Class({
         }else{
         }else{
             if (this.json.styles) this.node.setStyles(this.json.styles);
             if (this.json.styles) this.node.setStyles(this.json.styles);
             if (this.json.inputStyles) if (this.node.getFirst()) this.node.getFirst().setStyles(this.json.inputStyles);
             if (this.json.inputStyles) if (this.node.getFirst()) this.node.getFirst().setStyles(this.json.inputStyles);
-            if (this.iconNode){
+            if (this.iconNode && this.iconNode.offsetParent !== null){
                 var size = this.node.getSize();
                 var size = this.node.getSize();
                 this.iconNode.setStyle("height", ""+size.y+"px");
                 this.iconNode.setStyle("height", ""+size.y+"px");
             }
             }

+ 1 - 0
o2web/source/x_component_process_Xform/$Input.js

@@ -158,6 +158,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input =  new Class({
     _loadStyles: function(){
     _loadStyles: function(){
         if (this.json.styles) this.node.setStyles(this.json.styles);
         if (this.json.styles) this.node.setStyles(this.json.styles);
         if (this.json.inputStyles) if (this.node.getFirst()) this.node.getFirst().setStyles(this.json.inputStyles);
         if (this.json.inputStyles) if (this.node.getFirst()) this.node.getFirst().setStyles(this.json.inputStyles);
+        debugger;
         if (this.iconNode && this.iconNode.offsetParent !== null ){ //没有被隐藏
         if (this.iconNode && this.iconNode.offsetParent !== null ){ //没有被隐藏
             var size = this.node.getSize();
             var size = this.node.getSize();
             //if (!size.y){
             //if (!size.y){