diff --git a/o2web/source/x_component_Selector/Person.js b/o2web/source/x_component_Selector/Person.js index 2f92f9ceb65da4003d64f8c2f6231f38317ab857..5d9b56a34061fc2b431f3b040ba04d97fcb73df2 100644 --- a/o2web/source/x_component_Selector/Person.js +++ b/o2web/source/x_component_Selector/Person.js @@ -27,7 +27,7 @@ MWF.xApplication.Selector.Person = new Class({ "hasShuttle" : false, //穿梭按钮 "searchbarInTopNode" : true, //搜索框在标题上还是另起一行 "hasSelectedSearchbar" : false, //已选是不是有搜索框 - "noSelectedContainer" : true, //是否有已选项 + "noSelectedContainer" : false, //是否隐藏右侧已选区域 "contentUrl" : "", //和默认的页面布局不一样的话,可以传入页面布局HTML URL "injectToBody" : false, //当传入HTML URL的时候是否插入到document.body, false的时候插入到this.container @@ -2395,6 +2395,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({ if (!this.fx.isRunning()){ var display = this.children.getStyle("display"); if (display === "none"){ + this.selector.fireEvent("expand", [this] ); this.children.setStyles({ "display": "block", "height": "0px" @@ -2403,6 +2404,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({ this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_expand); this.isExpand = true; }else{ + this.selector.fireEvent("collapse", [this] ); if (!this.childrenHeight) this.childrenHeight = this.children.getStyle("height").toFloat(); this.fx.start("height", ""+this.childrenHeight+"px", "0px").chain(function(){ this.children.setStyles({ diff --git a/o2web/source/x_component_Selector/Unit.js b/o2web/source/x_component_Selector/Unit.js index 9194955187504ec57838bfc5adc39997d4d68207..cee91e9af377b9ed35d1ccddccf783ee79376f60 100644 --- a/o2web/source/x_component_Selector/Unit.js +++ b/o2web/source/x_component_Selector/Unit.js @@ -232,9 +232,9 @@ MWF.xApplication.Selector.Unit.Item = new Class({ debugger; if( !this.selector.options.expandSubEnable )return; this.isExpand = (this.selector.options.expand); - if ( this._hasChild() ){ + if ( this._hasChild() || this.selector.options.expandEmptyCategory ){ if (this.selector.options.expand){ - if (this.level===1){ + if (this.level===1 && this._hasChild() ){ this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_expand); this.loadSubItems(); }else{ @@ -246,10 +246,12 @@ MWF.xApplication.Selector.Unit.Item = new Class({ } this.levelNode.addEvent("click", function(e){ if (this.isExpand){ + this.selector.fireEvent("collapse", [this] ); this.children.setStyle("display", "none"); this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_collapse); this.isExpand = false; }else{ + this.selector.fireEvent("expand", [this] ); this.loadSubItems(); this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_expand); this.isExpand = true; diff --git a/o2web/source/x_component_Selector/UnitWithType.js b/o2web/source/x_component_Selector/UnitWithType.js index 297c1825ec5c6d8bc4107a46cc4c3a2b22f73895..b42b019b396415e4a87648f112656302cb02bae7 100644 --- a/o2web/source/x_component_Selector/UnitWithType.js +++ b/o2web/source/x_component_Selector/UnitWithType.js @@ -141,10 +141,12 @@ MWF.xApplication.Selector.UnitWithType.Item = new Class({ } this.levelNode.addEvent("click", function(e){ if (this.isExpand){ + this.selector.fireEvent("collapse", [this] ); this.children.setStyle("display", "none"); this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_collapse); this.isExpand = false; }else{ + this.selector.fireEvent("expand", [this] ); this.loadSubItems(); this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_expand); this.isExpand = true;