|
@@ -1462,7 +1462,7 @@ MWF.xApplication.Selector.Person = new Class({
|
|
|
if(this.items.length === 1 || this.subItems.length === 1 ){
|
|
if(this.items.length === 1 || this.subItems.length === 1 ){
|
|
|
if( this.items.length === 1 && this.subItems.length === 0 ){
|
|
if( this.items.length === 1 && this.subItems.length === 0 ){
|
|
|
if( !this.items[0].isSelected )this.items[0].clickItem();
|
|
if( !this.items[0].isSelected )this.items[0].clickItem();
|
|
|
- this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
|
|
|
|
|
|
|
+ this.fireEvent("afterSelectSingleItem",[this, this.items[0]]);
|
|
|
}else if( this.items.length === 0 && this.subItems.length === 1 ){
|
|
}else if( this.items.length === 0 && this.subItems.length === 1 ){
|
|
|
if( !this.items[0].isSelected )this.subItems[0].clickItem();
|
|
if( !this.items[0].isSelected )this.subItems[0].clickItem();
|
|
|
this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
|
|
this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
|
|
@@ -1470,20 +1470,31 @@ MWF.xApplication.Selector.Person = new Class({
|
|
|
if( this.items[0] === this.subItems[0] ){
|
|
if( this.items[0] === this.subItems[0] ){
|
|
|
if( !this.items[0].isSelected )this.items[0].clickItem();
|
|
if( !this.items[0].isSelected )this.items[0].clickItem();
|
|
|
this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
|
|
this.fireEvent("afterSelectSingleItem",[this, this.items[0]])
|
|
|
|
|
+ }else{
|
|
|
|
|
+ _self.fireEvent("afterCheckSelectSingleItem",[_self])
|
|
|
}
|
|
}
|
|
|
|
|
+ }else{
|
|
|
|
|
+ _self.fireEvent("afterCheckSelectSingleItem",[_self])
|
|
|
}
|
|
}
|
|
|
|
|
+ }else{
|
|
|
|
|
+ _self.fireEvent("afterCheckSelectSingleItem",[_self])
|
|
|
}
|
|
}
|
|
|
}.bind(this);
|
|
}.bind(this);
|
|
|
|
|
|
|
|
var checkCategoryItem = function (category) {
|
|
var checkCategoryItem = function (category) {
|
|
|
if( !category.subCategorys || category.subCategorys.length === 0 ){
|
|
if( !category.subCategorys || category.subCategorys.length === 0 ){
|
|
|
if( category.subItems && category.subItems.length === 1 ){
|
|
if( category.subItems && category.subItems.length === 1 ){
|
|
|
|
|
+ isSingleItem = true;
|
|
|
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
|
|
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
|
|
|
_self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
|
|
_self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
|
|
|
|
|
+ }else{
|
|
|
|
|
+ _self.fireEvent("afterCheckSelectSingleItem",[_self])
|
|
|
}
|
|
}
|
|
|
}else if(category.subCategorys.length === 1){
|
|
}else if(category.subCategorys.length === 1){
|
|
|
if( category.subItems && category.subItems.length > 0 ){
|
|
if( category.subItems && category.subItems.length > 0 ){
|
|
|
|
|
+ _self.fireEvent("afterCheckSelectSingleItem",[_self])
|
|
|
}else if( !category.subCategorys[0]._hasChild || !category.subCategorys[0]._hasChild() ){ //category.subCategorys[0].isItem &&
|
|
}else if( !category.subCategorys[0]._hasChild || !category.subCategorys[0]._hasChild() ){ //category.subCategorys[0].isItem &&
|
|
|
|
|
+ isSingleItem = true;
|
|
|
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
|
|
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
|
|
|
_self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
|
|
_self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
|
|
|
}else{
|
|
}else{
|
|
@@ -1503,9 +1514,14 @@ MWF.xApplication.Selector.Person = new Class({
|
|
|
}
|
|
}
|
|
|
if( list.length === 0 ){
|
|
if( list.length === 0 ){
|
|
|
if( category.subItems && category.subItems.length === 1 ){
|
|
if( category.subItems && category.subItems.length === 1 ){
|
|
|
|
|
+ isSingleItem = true;
|
|
|
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
|
|
if( !category.subItems[0].isSelected )category.subItems[0].clickItem();
|
|
|
_self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
|
|
_self.fireEvent("afterSelectSingleItem",[_self, category.subItems[0]])
|
|
|
|
|
+ }else{
|
|
|
|
|
+ _self.fireEvent("afterCheckSelectSingleItem",[_self])
|
|
|
}
|
|
}
|
|
|
|
|
+ }else{
|
|
|
|
|
+ _self.fireEvent("afterCheckSelectSingleItem",[_self])
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -1521,10 +1537,12 @@ MWF.xApplication.Selector.Person = new Class({
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- if( this.subCategorys.length === 1 ) {
|
|
|
|
|
|
|
+ if( this.subCategorys.length === 1 && this.subItems.length === 0) {
|
|
|
checkCategory( this.subCategorys[0] );
|
|
checkCategory( this.subCategorys[0] );
|
|
|
}else if( this.subCategorys.length === 0 ){
|
|
}else if( this.subCategorys.length === 0 ){
|
|
|
checkItem();
|
|
checkItem();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ _self.fireEvent("afterCheckSelectSingleItem",[_self])
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
setSize : function(){
|
|
setSize : function(){
|
|
@@ -2034,7 +2052,7 @@ MWF.xApplication.Selector.Person.Item = new Class({
|
|
|
this.selector.fireEvent("unselectItem",[this]);
|
|
this.selector.fireEvent("unselectItem",[this]);
|
|
|
if( checkValid )this.selector.fireEvent("valid", [this.selector, this]);
|
|
if( checkValid )this.selector.fireEvent("valid", [this.selector, this]);
|
|
|
},
|
|
},
|
|
|
- selected: function( checkValid, callback, selectedNode, byelectAll ){
|
|
|
|
|
|
|
+ selected: function( checkValid, callback, selectedNode, bySelectAll ){
|
|
|
debugger;
|
|
debugger;
|
|
|
var count = this.selector.options.maxCount || this.selector.options.count;
|
|
var count = this.selector.options.maxCount || this.selector.options.count;
|
|
|
count = count.toInt();
|
|
count = count.toInt();
|