From ab5960acbd1fb13f9e650cbc18f8ef058cb0e02b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Jul 2020 10:55:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=BA=BA=E7=95=8C=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=80=89=E6=8B=A9=E5=99=A8=E5=BD=93?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E6=97=A0=E5=80=99=E9=80=89=E9=A1=B9=E6=97=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=EF=BC=9A=E6=97=A0=E5=BE=85=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../$Selector/blue_flat/css.wcss | 6 +++ .../$Selector/blue_flat_mobile/css.wcss | 3 ++ .../$Selector/default/css.wcss | 8 ++- .../$Selector/embed/css.wcss | 6 +++ .../$Selector/mobile/css.wcss | 6 +++ .../$Selector/process/css.wcss | 6 +++ o2web/source/x_component_Selector/Identity.js | 17 ++++++- .../x_component_Selector/IdentityWidthDuty.js | 26 +++++++++- .../IdentityWidthDutyCategoryByUnit.js | 12 ++++- o2web/source/x_component_Selector/Person.js | 51 +++++++++++-------- o2web/source/x_component_Selector/Unit.js | 31 +++++++++-- .../x_component_Selector/UnitWithType.js | 12 +++-- o2web/source/x_component_Selector/lp/zh-cn.js | 2 +- .../x_component_Template/Selector/Custom.js | 36 ++++++++++--- 14 files changed, 181 insertions(+), 41 deletions(-) diff --git a/o2web/source/x_component_Selector/$Selector/blue_flat/css.wcss b/o2web/source/x_component_Selector/$Selector/blue_flat/css.wcss index b4f6ba3355..78954a3886 100644 --- a/o2web/source/x_component_Selector/$Selector/blue_flat/css.wcss +++ b/o2web/source/x_component_Selector/$Selector/blue_flat/css.wcss @@ -112,6 +112,12 @@ "overflow": "hidden", "padding" : "20px" }, + "noSelectableItemText" : { + "margin" : "10px auto", + "text-align" : "center", + "width" : "200px", + "color" : "#999" + }, "contentNode_embedded": { "overflow": "hidden", "padding" : "5px 0px 0px 0px" diff --git a/o2web/source/x_component_Selector/$Selector/blue_flat_mobile/css.wcss b/o2web/source/x_component_Selector/$Selector/blue_flat_mobile/css.wcss index aa4ede91b1..8b1adbab29 100644 --- a/o2web/source/x_component_Selector/$Selector/blue_flat_mobile/css.wcss +++ b/o2web/source/x_component_Selector/$Selector/blue_flat_mobile/css.wcss @@ -85,6 +85,9 @@ "contentNode": { "overflow": "hidden" }, + "noSelectableItemText" : { + "display" : "none" + }, "contentNode_embedded": { "overflow": "hidden", "padding" : "5px 0px 0px 0px" diff --git a/o2web/source/x_component_Selector/$Selector/default/css.wcss b/o2web/source/x_component_Selector/$Selector/default/css.wcss index e02c6840fe..5e4fb130ad 100644 --- a/o2web/source/x_component_Selector/$Selector/default/css.wcss +++ b/o2web/source/x_component_Selector/$Selector/default/css.wcss @@ -148,6 +148,12 @@ "contentNode": { "overflow": "hidden" }, + "noSelectableItemText" : { + "margin" : "10px auto", + "text-align" : "center", + "width" : "200px", + "color" : "#999" + }, "selectNode": { "width": "331px", "height": "410px", @@ -276,7 +282,7 @@ "padding": "0px 9px", "height": "40px", "border-bottom": "1px solid #999", - "background-color": "#EEE", + "background-color": "#EEE" }, "letterNode": { "height": "20px", diff --git a/o2web/source/x_component_Selector/$Selector/embed/css.wcss b/o2web/source/x_component_Selector/$Selector/embed/css.wcss index 4e14a48646..39e399bb70 100644 --- a/o2web/source/x_component_Selector/$Selector/embed/css.wcss +++ b/o2web/source/x_component_Selector/$Selector/embed/css.wcss @@ -119,6 +119,12 @@ "contentNode": { "overflow": "hidden" }, + "noSelectableItemText" : { + "margin" : "10px auto", + "text-align" : "center", + "width" : "200px", + "color" : "#999" + }, "selectNode": { "height": "410px", "margin": "0px", diff --git a/o2web/source/x_component_Selector/$Selector/mobile/css.wcss b/o2web/source/x_component_Selector/$Selector/mobile/css.wcss index d7138eff73..d049e22474 100644 --- a/o2web/source/x_component_Selector/$Selector/mobile/css.wcss +++ b/o2web/source/x_component_Selector/$Selector/mobile/css.wcss @@ -47,6 +47,12 @@ "contentNode": { "overflow": "hidden" }, + "noSelectableItemText" : { + "margin" : "10px auto", + "text-align" : "center", + "width" : "200px", + "color" : "#999" + }, "selectNode": { "width": "40%", "height": "80%", diff --git a/o2web/source/x_component_Selector/$Selector/process/css.wcss b/o2web/source/x_component_Selector/$Selector/process/css.wcss index f1963e993a..d0c1614e27 100644 --- a/o2web/source/x_component_Selector/$Selector/process/css.wcss +++ b/o2web/source/x_component_Selector/$Selector/process/css.wcss @@ -119,6 +119,12 @@ "contentNode": { "overflow": "hidden" }, + "noSelectableItemText" : { + "margin" : "10px auto", + "text-align" : "center", + "width" : "200px", + "color" : "#999" + }, "selectNode": { //"width": "200px", "width": "54%", diff --git a/o2web/source/x_component_Selector/Identity.js b/o2web/source/x_component_Selector/Identity.js index e44697cc5a..304f903a5c 100644 --- a/o2web/source/x_component_Selector/Identity.js +++ b/o2web/source/x_component_Selector/Identity.js @@ -84,6 +84,13 @@ MWF.xApplication.Selector.Identity = new Class({ }.bind(this)); }else{ + // this.loadInclude( function () { + // this.includeLoaded = true; + // if( this.unitLoaded ){ + // afterLoadSelectItemFun(); + // } + // }.bind(this)); + this.orgAction.listTopUnit(function(json){ json.data.each(function(data){ if( !this.isExcluded( data ) ){ @@ -91,8 +98,13 @@ MWF.xApplication.Selector.Identity = new Class({ this.subCategorys.push( category ); } }.bind(this)); - loadUnitSuccess(); - }.bind(this), loadUnitFailure); + + // this.unitLoaded = true; + // if( this.includeLoaded ){ + afterLoadSelectItemFun(); + // } + + }.bind(this)); } }, @@ -419,6 +431,7 @@ MWF.xApplication.Selector.Identity.ItemCategory = new Class({ this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_expand); this.isExpand = true; } + // this.checkSelectAll(); }else{ var display = this.children.getStyle("display"); if (display === "none"){ diff --git a/o2web/source/x_component_Selector/IdentityWidthDuty.js b/o2web/source/x_component_Selector/IdentityWidthDuty.js index ab4816bf7b..0e81a08fcc 100644 --- a/o2web/source/x_component_Selector/IdentityWidthDuty.js +++ b/o2web/source/x_component_Selector/IdentityWidthDuty.js @@ -19,6 +19,9 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({ "exclude" : [] }, loadSelectItems: function(addToNext){ + + var afterLoadSelectItemFun = this.afterLoadSelectItem.bind(this); + if( this.options.resultType === "person" ){ if( this.titleTextNode ){ this.titleTextNode.set("text", MWF.xApplication.Selector.LP.selectPerson ); @@ -27,7 +30,27 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({ } } if (this.options.dutys.length){ - this.loadInclude(); + var dutyLoaded = 0; + + var loadDutySuccess = function () { + dutyLoaded++; + if( dutyLoaded === this.options.dutys.length ){ + this.dutyLoaded = true; + if( this.includeLoaded ){ + afterLoadSelectItemFun(); + } + } + }.bind(this); + + this.loadInclude( function () { + this.includeLoaded = true; + if( this.dutyLoaded ){ + afterLoadSelectItemFun(); + } + }.bind(this)); + + + // this.loadInclude(); this.options.dutys.each(function(duty){ var data = {"name": duty, "id":duty}; var category = this._newItemCategory("ItemCategory",data, this, this.itemAreaNode); @@ -37,6 +60,7 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({ // this.action.getUnitduty(function(dutyData){ // var category = this._newItemCategory("ItemCategory", dutyData.data, this, this.itemAreaNode); // }.bind(this), null, duty); + loadDutySuccess(); }.bind(this)); } }, diff --git a/o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js b/o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js index f9a398d048..02e0a0f93e 100644 --- a/o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js +++ b/o2web/source/x_component_Selector/IdentityWidthDutyCategoryByUnit.js @@ -30,7 +30,12 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({ } if (this.options.dutys.length){ - this.loadInclude(); + this.loadInclude( function () { + this.includeLoaded = true; + if( this.dutyLoaded ){ + this.afterLoadSelectItem(); + } + }.bind(this)); if( this.options.units.length ){ var units = []; @@ -91,6 +96,11 @@ MWF.xApplication.Selector.IdentityWidthDutyCategoryByUnit = new Class({ }else{ this._loadSelectItemsByIdentityUnit(unitTree); } + + this.dutyLoaded = true; + if( this.includeLoaded ){ + this.afterLoadSelectItem(); + } }, _loadSelectItemsByIdentityUnit : function( unitTree ){ if( !unitTree.unitList )return; diff --git a/o2web/source/x_component_Selector/Person.js b/o2web/source/x_component_Selector/Person.js index 21a6bc47e7..a8300471df 100644 --- a/o2web/source/x_component_Selector/Person.js +++ b/o2web/source/x_component_Selector/Person.js @@ -1362,9 +1362,10 @@ MWF.xApplication.Selector.Person = new Class({ } }, afterLoadSelectItem : function(){ - if( this.items.length === 0 ){ //&& this.subCategorys.length === 0 + if( this.subItems.length === 0 && this.subCategorys.length === 0 ){ this.noSelectableItemTextDiv = new Element("div", { - text : this.lp.noSelectableItemText + text : MWF.SelectorLP.noSelectableItemText, + styles : this.css.noSelectableItemText }).inject( this.itemAreaNode ); } this.fireEvent("afterLoadSelectItem", [this]); @@ -1748,9 +1749,9 @@ MWF.xApplication.Selector.Person.Item = new Class({ if( ( this.selector.options.count.toInt() === 1 || this.selector.options.noSelectedContainer ) && this.selector.css.selectorItemActionNode_single_selected ){ this.actionNode.setStyles( this.selector.css.selectorItemActionNode_single_selected ); } - // if( this.category ){ - // this.category.checkSelectAll(); - // } + if( this.category ){ + this.category.checkSelectAll(); + } }, setEvent: function(){ this.node.addEvents({ @@ -1875,9 +1876,9 @@ MWF.xApplication.Selector.Person.Item = new Class({ this.selectedItem.check(); this.selector.selectedItems.push(this.selectedItem); - if( this.category ){ - this.category.checkSelectAll(); - } + // if( this.category ){ + // this.category.checkSelectAll(); + // } this.selector.fireEvent("selectItem",[this]) }else{ @@ -2256,21 +2257,27 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({ }).inject(this.node, "after"); 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"); - } + if( this.selector.options.expandEmptyCategory && !this._hasChildItem() ){ //点击允许展开空分类 + this.children.hide(); + this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_collapse); + this.isExpand = false; + }else{ + 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()){ - this.actionNode.setStyle("background", "transparent"); - this.textNode.setStyle("color", "#777"); - } + if ( !this._hasChild()){ + this.actionNode.setStyle("background", "transparent"); + this.textNode.setStyle("color", "#777"); + } - if( this.selectAllNode ){ - if( this.selector.options.selectAllRange === "direct" && !this._hasChildItem() ){ - this.selectAllNode.setStyle("display", "none"); + if( this.selectAllNode ){ + if( this.selector.options.selectAllRange === "direct" && !this._hasChildItem() ){ + this.selectAllNode.setStyle("display", "none"); + } } } @@ -2433,7 +2440,7 @@ MWF.xApplication.Selector.Person.ItemCategory = new Class({ } }, clickItem: function( callback ){ - if (this._hasChild()){ + if (this._hasChild() || this.selector.options.expandEmptyCategory ){ if (!this.fx){ this.fx = new Fx.Tween(this.children, { "duration": 200 diff --git a/o2web/source/x_component_Selector/Unit.js b/o2web/source/x_component_Selector/Unit.js index 13c3fb51b1..2335369c18 100644 --- a/o2web/source/x_component_Selector/Unit.js +++ b/o2web/source/x_component_Selector/Unit.js @@ -17,7 +17,19 @@ MWF.xApplication.Selector.Unit = new Class({ }, loadSelectItems: function(addToNext){ + var afterLoadSelectItemFun = this.afterLoadSelectItem.bind(this); + if (this.options.units.length){ + var unitLoaded = 0; + + var loadUnitSuccess = function () { + unitLoaded++; + if( unitLoaded === this.options.units.length ){ + afterLoadSelectItemFun(); + } + }.bind(this); + var loadUnitFailure = loadUnitSuccess; + this.options.units.each(function(unit){ var container = new Element("div").inject( this.itemAreaNode ); @@ -49,11 +61,13 @@ MWF.xApplication.Selector.Unit = new Class({ } }else{ var item = this._newItem( data, this, container ); + this.items.push( item ); this.subItems.push(item); } }.bind(this)); } - }.bind(this), null, unit); + loadUnitSuccess(); + }.bind(this), loadUnitFailure, unit); }else{ @@ -68,11 +82,13 @@ MWF.xApplication.Selector.Unit = new Class({ } }else{ var item = this._newItem(data, this, container ); + this.items.push( item ); this.subItems.push(item); } }.bind(this)); } - }.bind(this), null, unit.id); + loadUnitSuccess(); + }.bind(this), loadUnitFailure, unit.id); //if (unit.subDirectUnitCount) var category = this._newItemCategory("ItemCategory", unit, this, this.itemAreaNode); } @@ -89,6 +105,7 @@ MWF.xApplication.Selector.Unit = new Class({ // if (flag){ if( !this.isExcluded( data ) ) { var unit = this._newItem(data, this, this.itemAreaNode, 1); + this.items.push( unit ); this.subItems.push(unit); } //unit.loadSubItem(); @@ -97,6 +114,7 @@ MWF.xApplication.Selector.Unit = new Class({ // } }.bind(this)); + afterLoadSelectItemFun(); }.bind(this)); } }, @@ -234,7 +252,6 @@ MWF.xApplication.Selector.Unit.Item = new Class({ this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/"+style+"/icon/departmenticon.png)"); }, loadSubItem: function(){ - debugger; if( !this.selector.options.expandSubEnable )return; this.isExpand = (this.selector.options.expand); if ( this._hasChild() || this.selector.options.expandEmptyCategory ){ @@ -243,6 +260,9 @@ MWF.xApplication.Selector.Unit.Item = new Class({ if (this.level <= this.selector.options.defaultExpandLevel && this._hasChild() ){ this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_expand); this.loadSubItems(); + }else{ + this.isExpand = false; + this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_collapse); } }else if (this.level===1 && this._hasChild() ){ this.levelNode.setStyles(this.selector.css.selectorItemLevelNode_expand); @@ -455,6 +475,7 @@ MWF.xApplication.Selector.Unit.Item = new Class({ subJson.data.each(function(subData){ if( !this.selector.isExcluded( subData ) ) { var category = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this); + this.selector.items.push( category ); if( !this.subItems )this.subItems = []; this.subItems.push( category ); } @@ -637,6 +658,7 @@ MWF.xApplication.Selector.Unit.Item = new Class({ var category = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this, true); category.justItem = true; category.load(); + this.selector.items.push( category ); if( !this.subItems )this.subItems = []; this.subItems.push( category ); //} @@ -684,6 +706,7 @@ MWF.xApplication.Selector.Unit.SearchItem = new Class({ }else{ category = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this); } + this.selector.items.push( category ); if( !this.subItems )this.subItems = []; this.subItems.push( category ); } @@ -723,6 +746,7 @@ MWF.xApplication.Selector.Unit.ItemCategory = new Class({ subJson.data.each(function(subData){ if( !this.selector.isExcluded( subData ) ) { var category = this.selector._newItem(subData, this.selector, this.children, this.level+1, this); + this.selector.items.push( category ); if(this.subItems)this.subItems.push( category ); this.subCategorys.push( category ); } @@ -783,6 +807,7 @@ MWF.xApplication.Selector.Unit.ItemCategory = new Class({ var category = this.selector._newItem(subData, this.selector, this.children, this.level+1, this, true); category.justItem = true; category.load(); + this.selector.items.push( category ); if(this.subItems)this.subItems.push( category ); //this.subCategorys.push( category ); } diff --git a/o2web/source/x_component_Selector/UnitWithType.js b/o2web/source/x_component_Selector/UnitWithType.js index 18d1e24367..c5a122475e 100644 --- a/o2web/source/x_component_Selector/UnitWithType.js +++ b/o2web/source/x_component_Selector/UnitWithType.js @@ -17,6 +17,8 @@ MWF.xApplication.Selector.UnitWithType = new Class({ }, loadSelectItems: function(addToNext){ + var afterLoadSelectItemFun = this.afterLoadSelectItem.bind(this); + var data = {}; data.type = this.options.unitType; data.unitList = []; @@ -35,6 +37,7 @@ MWF.xApplication.Selector.UnitWithType = new Class({ if( !this.isExcluded( data ) ) { if ( !this.options.expandSubEnable || (!this.options.unitType) || data.typeList.indexOf(this.options.unitType)!==-1){ var unit = this._newItem(data, this, this.itemAreaNode, 1); + this.items.push(unit); this.subItems.push(unit); }else{ if (data.woSubDirectUnitList.length){ @@ -45,7 +48,8 @@ MWF.xApplication.Selector.UnitWithType = new Class({ } }.bind(this)); } - }.bind(this), null, data); + afterLoadSelectItemFun(); + }.bind(this), afterLoadSelectItemFun, data); }, _scrollEvent: function(y){ @@ -190,6 +194,7 @@ MWF.xApplication.Selector.UnitWithType.Item = new Class({ if( !this.selector.isExcluded( subData ) ) { if ((!this.selector.options.unitType) || subData.typeList.indexOf(this.selector.options.unitType) !== -1) { var unit = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this); + this.selector.items.push( unit ); if( !this.subItems )this.subItems = []; this.subItems.push( unit ); } else { @@ -241,8 +246,9 @@ MWF.xApplication.Selector.UnitWithType.Item = new Class({ if( !this.selector.isExcluded( subData ) ) { if ((!this.selector.options.unitType) || subData.typeList.indexOf(this.selector.options.unitType) !== -1) { var unit = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this, true); - category.justItem = true; - category.load(); + unit.justItem = true; + unit.load(); + this.selector.items.push( unit ); if( !this.subItems )this.subItems = []; this.subItems.push( unit ); } diff --git a/o2web/source/x_component_Selector/lp/zh-cn.js b/o2web/source/x_component_Selector/lp/zh-cn.js index 3dd0ad6b76..fc528ddbf3 100644 --- a/o2web/source/x_component_Selector/lp/zh-cn.js +++ b/o2web/source/x_component_Selector/lp/zh-cn.js @@ -15,7 +15,7 @@ MWF.xApplication.Selector.LP = MWF.SelectorLP = { "selectTable": "选择数据表", "selectCMSApplication": "选择内容管理应用", "selectCMSCategory": "选择内容管理栏目", - "noSelectableItemText" : "无可选项,请联系管理员", + "noSelectableItemText" : "无待选项", "searchDescription" : "搜索内容", diff --git a/o2web/source/x_component_Template/Selector/Custom.js b/o2web/source/x_component_Template/Selector/Custom.js index 0810deca66..25f42ab597 100644 --- a/o2web/source/x_component_Template/Selector/Custom.js +++ b/o2web/source/x_component_Template/Selector/Custom.js @@ -68,31 +68,36 @@ MWF.xApplication.Template.Selector.Custom = new Class({ this.container = $(container); this.selectedItems = []; this.items = []; - this.categorys = []; + // this.categorys = []; + + this.subCategorys = []; //直接的分类 + this.subItems = []; //直接的选择项 }, loadSelectItems: function (addToNext) { - debugger; if (!this.options.category) { this.options.selectableItems.each(function (it) { var name = typeOf(it) === "string" ? it : it.name; var id = typeOf(it) === "string" ? it : it.id; var item = this._newItem({name: name, id: id}, this, this.itemAreaNode); this.items.push(item); + this.subItems.push( item ); }.bind(this)) } else { this.options.selectableItems.each(function (item, index) { if (item.isItem) { var item = this._newItem(item, this, this.itemAreaNode); this.items.push(item); + this.subItems.push( item ); }else{ // if ( (item.subItemList && item.subItemList.length > 0) || item.subCategoryList && item.subCategoryList.length > 0 ) { if( this.options.categorySelectable ){ var category = this._newItemCategorySelectable(item, this, this.itemAreaNode); this.items.push(category); - this.categorys.push( category ); + this.subItems.push( category ); + this.subCategorys.push( category ); }else{ var category = this._newItemCategory(item, this, this.itemAreaNode); - this.categorys.push( category ); + this.subCategorys.push( category ); } // item.subItemList.each(function (subItem, index) { // var item = this._newItem(subItem, this, category.children, 2, category); @@ -103,6 +108,7 @@ MWF.xApplication.Template.Selector.Custom = new Class({ } }.bind(this)); } + if(this.afterLoadSelectItem)this.afterLoadSelectItem(); }, _scrollEvent: function (y) { return true; @@ -310,22 +316,32 @@ MWF.xApplication.Template.Selector.Custom.ItemCategory = new Class({ return this.data.name; }, clickItem: function (callback) { - if (this._hasChild()) { + if (this._hasChild() || this.selector.options.expandEmptyCategory ) { var firstLoaded = !this.loaded; + if( !firstLoaded || this.selector.options.expandEmptyCategory ){ + if(this.isExpand){ + this.selector.fireEvent("collapse", [this] ); + }else{ + this.selector.fireEvent("expand", [this] ); + } + } this.loadSub(function () { - if (firstLoaded) { + if (firstLoaded && this._hasChild() ) { if (!this.selector.isFlatCategory) { this.children.setStyles({"display": "block", "height": "auto"}); this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_expand); this.isExpand = true; } + // this.checkSelectAll(); } else { var display = this.children.getStyle("display"); if (display === "none") { + // this.selector.fireEvent("expand", [this] ); this.children.setStyles({"display": "block", "height": "auto"}); this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_expand); this.isExpand = true; } else { + // this.selector.fireEvent("collapse", [this] ); this.children.setStyles({"display": "none", "height": "0px"}); this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_collapse); this.isExpand = false; @@ -390,7 +406,13 @@ MWF.xApplication.Template.Selector.Custom.ItemCategory = new Class({ check: function () { }, afterLoad: function(){ - if ( this.level <= this.selector.options.defaultExpandLevel ) this.clickItem(); + if ( this.level <= this.selector.options.defaultExpandLevel && (this._hasChild()) ){ + this.clickItem(); + }else{ + this.children.hide(); + this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_collapse); + this.isExpand = false; + } } }); -- GitLab