Преглед изворни кода

修复选人的时候高度的问题

unknown пре 5 година
родитељ
комит
8286b2e904
2 измењених фајлова са 9 додато и 9 уклоњено
  1. 7 7
      o2web/source/x_component_Selector/Person.js
  2. 2 2
      o2web/source/x_component_Selector/Unit.js

+ 7 - 7
o2web/source/x_component_Selector/Person.js

@@ -2211,12 +2211,12 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
         }).inject(this.node, "after");
         }).inject(this.node, "after");
         if (!this.selector.options.expand) this.children.setStyle("display", "none");
         if (!this.selector.options.expand) this.children.setStyle("display", "none");
 
 
-        // var subIdList = this.selector._getChildrenItemIds(this.data);
-        // if (subIdList){
-        //     var count = subIdList.length;
-        //     this.childrenHeight = count*this.selector.options.itemHeight;
-        //     this.children.setStyle("height", ""+this.childrenHeight+"px");
-        // }
+        var subIdList = this.selector._getChildrenItemIds(this.data);
+        if (subIdList){
+            var count = subIdList.length;
+            this.childrenHeight = count*this.selector.options.itemHeight;
+            this.children.setStyle("height", ""+this.childrenHeight+"px");
+        }
 
 
         if (!this._hasChild()){
         if (!this._hasChild()){
             this.actionNode.setStyle("background", "transparent");
             this.actionNode.setStyle("background", "transparent");
@@ -2346,7 +2346,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({
             }else if (display === "none"){
             }else if (display === "none"){
                 this.children.setStyles({
                 this.children.setStyles({
                     "display": "block",
                     "display": "block",
-                    "height": this.childrenHeight+"px"
+                    "height": "auto"
                 });
                 });
                 this.node.setStyles( this.selector.css.flatCategoryItemNode_selected );
                 this.node.setStyles( this.selector.css.flatCategoryItemNode_selected );
                 this.isExpand = true;
                 this.isExpand = true;

+ 2 - 2
o2web/source/x_component_Selector/Unit.js

@@ -555,13 +555,13 @@ MWF.xApplication.Selector.Unit.Item = new Class({
                 this.flatCategoryItemNode.setStyles(this.selector.css.flatCategoryItemNode);
                 this.flatCategoryItemNode.setStyles(this.selector.css.flatCategoryItemNode);
                 this.isExpand = false;
                 this.isExpand = false;
             }else if( firstLoaded ){
             }else if( firstLoaded ){
-                this.children.setStyles({"display": "block"});
+                this.children.setStyles({ "display": "block", "height" : "auto" });
                 this.flatCategoryItemNode.setStyles( this.selector.css.flatCategoryItemNode_selected );
                 this.flatCategoryItemNode.setStyles( this.selector.css.flatCategoryItemNode_selected );
                 this.isExpand = true;
                 this.isExpand = true;
             }else {
             }else {
                 var display = this.children.getStyle("display");
                 var display = this.children.getStyle("display");
                 if (display === "none") {
                 if (display === "none") {
-                    this.children.setStyles({ "display": "block" });
+                    this.children.setStyles({ "display": "block" , "height" : "auto"});
                     this.flatCategoryItemNode.setStyles(this.selector.css.flatCategoryItemNode_selected);
                     this.flatCategoryItemNode.setStyles(this.selector.css.flatCategoryItemNode_selected);
                     this.isExpand = true;
                     this.isExpand = true;
                 } else {
                 } else {