|
|
@ -93,10 +93,23 @@ BI.SelectList = BI.inherit(BI.Widget, { |
|
|
|
var notSelectLength = this.getAllLeaves().length - selectLength; |
|
|
|
var notSelectLength = this.getAllLeaves().length - selectLength; |
|
|
|
var hasNext = this.list.hasNext(); |
|
|
|
var hasNext = this.list.hasNext(); |
|
|
|
var isAlreadyAllSelected = this.toolbar.isSelected(); |
|
|
|
var isAlreadyAllSelected = this.toolbar.isSelected(); |
|
|
|
var isHalf = selectLength > 0 && (notSelectLength > 0 || (!isAlreadyAllSelected && hasNext)); |
|
|
|
var isHalf = selectLength > 0 && notSelectLength > 0; |
|
|
|
isHalf = isHalf || (notSelectLength > 0 && hasNext && isAlreadyAllSelected); |
|
|
|
var allSelected = isAlreadyAllSelected; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.isAllSelected() === false) { |
|
|
|
|
|
|
|
hasNext && (isHalf = selectLength > 0); |
|
|
|
|
|
|
|
if (!isAlreadyAllSelected && notSelectLength === 0 && !hasNext) { |
|
|
|
|
|
|
|
allSelected = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
hasNext && (isHalf = notSelectLength > 0); |
|
|
|
|
|
|
|
if (!isAlreadyAllSelected && notSelectLength === 0) { |
|
|
|
|
|
|
|
allSelected = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.toolbar.setHalfSelected(isHalf); |
|
|
|
this.toolbar.setHalfSelected(isHalf); |
|
|
|
!isHalf && this.toolbar.setSelected(selectLength > 0 && notSelectLength <= 0 && (!hasNext || isAlreadyAllSelected)); |
|
|
|
!isHalf && this.toolbar.setSelected(allSelected); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setAllSelected: function (v) { |
|
|
|
setAllSelected: function (v) { |
|
|
|