提交 ba0aa83b 编写于 作者: 蔡祥熠

Merge branch 'fix/Selector.dlbclick_category_exectpion' into 'wrdp'

Merge of fix/【人员选择】修复人员选择双击可能重复加载的问题to wrdp

See merge request o2oa/o2oa!1443

(cherry picked from commit 2212a6a44f8b7cb824cee1e288de9cfee284d49c)

78ac135e 修复人员选择双击分类可能出现重复加载的情况
上级 797be5db
......@@ -495,9 +495,11 @@ MWF.xApplication.Selector.Identity.ItemCategory = new Class({
}
},
clickItem: function( callback ){
if (this._hasChild()){
if (this._hasChild() && !this.loading){
var firstLoaded = !this.loaded;
this.loading = true;
this.loadSub(function(){
this.loading = false;
if( firstLoaded ){
if( !this.selector.isFlatCategory ){
this.children.setStyles({"display": "block", "height": "auto"});
......
......@@ -193,8 +193,8 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/"+style+"/icon/companyicon.png)");
},
loadSub: function(callback){
if (!this.loaded && !this.loading){
this.loading = true;
if (!this.loaded && !this.loadingsub){
this.loadingsub = true;
if (this.selector.options.units.length){
var action = MWF.Actions.get("x_organization_assemble_express");
var data = {"name":this.data.name, "unit":""};
......@@ -234,7 +234,7 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
if (i>=count){
if (!this.loaded) {
this.loaded = true;
this.loading = false;
this.loadingsub = false;
this.itemLoaded = true;
if (callback) callback();
}
......@@ -259,7 +259,7 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
if (i>=count){
if (!this.loaded) {
this.loaded = true;
this.loading = false;
this.loadingsub = false;
this.itemLoaded = true;
if (callback) callback();
}
......@@ -279,7 +279,7 @@ MWF.xApplication.Selector.IdentityWidthDuty.ItemCategory = new Class({
}
}.bind(this));
this.loaded = true;
this.loading = false;
this.loadingsub = false;
if (callback) callback();
}.bind(this), null, this.data.name);
}
......
......@@ -510,7 +510,8 @@ MWF.xApplication.Selector.Unit.Item = new Class({
}
},
loadSubItems: function( callback ){
if (!this.loaded){
if (!this.loaded && !this.loading){
this.loading = true;
if (!this.children){
this.children = new Element("div", {
"styles": this.selector.css.selectorItemCategoryChildrenNode
......@@ -529,6 +530,7 @@ MWF.xApplication.Selector.Unit.Item = new Class({
}
}.bind(this));
this.loaded = true;
this.loading = false;
if(callback)callback();
}.bind(this), null, this.data.distinguishedName);
}else{
......@@ -734,7 +736,8 @@ MWF.xApplication.Selector.Unit.SearchItem = new Class({
},
loadSubItems: function( callback ){
//只是为了在isFlatCategory模式下,加载全称用的,否则用继承的就可以
if (!this.loaded){
if (!this.loaded && !this.loading){
this.loading = true;
if (!this.children){
this.children = new Element("div", {
"styles": this.selector.css.selectorItemCategoryChildrenNode
......@@ -760,6 +763,7 @@ MWF.xApplication.Selector.Unit.SearchItem = new Class({
}
}.bind(this));
this.loaded = true;
this.loading = false;
if(callback)callback();
}.bind(this), null, this.data.distinguishedName);
}else{
......
......@@ -183,7 +183,8 @@ MWF.xApplication.Selector.UnitWithType.Item = new Class({
}
},
loadSubItems: function(callback){
if (!this.loaded){
if (!this.loaded && !this.loading){
this.loading = true;
if (!this.children){
this.children = new Element("div", {
"styles": this.selector.css.selectorItemCategoryChildrenNode
......@@ -207,6 +208,7 @@ MWF.xApplication.Selector.UnitWithType.Item = new Class({
if(callback)callback()
}.bind(this));
this.loaded = true;
this.loading = false;
}else{
this.children.setStyle("display", "block");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册