|
|
@ -12,10 +12,12 @@ |
|
|
|
this.id = this.options.id; |
|
|
|
this.id = this.options.id; |
|
|
|
// renderService是否已经注册了滚动
|
|
|
|
// renderService是否已经注册了滚动
|
|
|
|
this.hasBinded = false; |
|
|
|
this.hasBinded = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.container = this.options.container; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getNodeListBounds: function (tId) { |
|
|
|
_getNodeListBounds: function (tId) { |
|
|
|
var nodeList = $("#" + this.id + " #" + tId + "_ul")[0]; |
|
|
|
var nodeList = BI.$("#" + this.id + " #" + tId + "_ul")[0]; |
|
|
|
return { |
|
|
|
return { |
|
|
|
top: nodeList.offsetTop, |
|
|
|
top: nodeList.offsetTop, |
|
|
|
left: nodeList.offsetLeft, |
|
|
|
left: nodeList.offsetLeft, |
|
|
@ -24,14 +26,17 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getTreeContainerBounds: function() { |
|
|
|
_getTreeContainerBounds: function () { |
|
|
|
var nodeList = $("#" + this.id).parent()[0]; |
|
|
|
var nodeList = this.container[0]; |
|
|
|
return { |
|
|
|
if (BI.isNotNull(nodeList)) { |
|
|
|
top: nodeList.offsetTop + nodeList.scrollTop, |
|
|
|
return { |
|
|
|
left: nodeList.offsetLeft + nodeList.scrollLeft, |
|
|
|
top: nodeList.offsetTop + nodeList.scrollTop, |
|
|
|
width: nodeList.offsetWidth, |
|
|
|
left: nodeList.offsetLeft + nodeList.scrollLeft, |
|
|
|
height: nodeList.offsetHeight |
|
|
|
width: nodeList.offsetWidth, |
|
|
|
|
|
|
|
height: nodeList.offsetHeight |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return {}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_canNodePopulate: function (tId) { |
|
|
|
_canNodePopulate: function (tId) { |
|
|
@ -50,7 +55,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_isNodeInVisible: function (tId) { |
|
|
|
_isNodeInVisible: function (tId) { |
|
|
|
var nodeList = $("#" + this.id + " #" + tId + "_ul"); |
|
|
|
var nodeList = BI.$("#" + this.id + " #" + tId + "_ul"); |
|
|
|
return nodeList.length === 0 || nodeList.css("display") === "none"; |
|
|
|
return nodeList.length === 0 || nodeList.css("display") === "none"; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -72,7 +77,7 @@ |
|
|
|
if(!this.hasBinded) { |
|
|
|
if(!this.hasBinded) { |
|
|
|
// console.log("绑定事件");
|
|
|
|
// console.log("绑定事件");
|
|
|
|
this.hasBinded = true; |
|
|
|
this.hasBinded = true; |
|
|
|
$("#" + this.id).parent().on("scroll", BI.debounce(function () { |
|
|
|
this.container && this.container.on("scroll", BI.debounce(function () { |
|
|
|
self.refreshAllNodes(); |
|
|
|
self.refreshAllNodes(); |
|
|
|
}, 30)); |
|
|
|
}, 30)); |
|
|
|
} |
|
|
|
} |
|
|
@ -109,7 +114,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.nodeLists = {}; |
|
|
|
this.nodeLists = {}; |
|
|
|
// console.log("解绑事件");
|
|
|
|
// console.log("解绑事件");
|
|
|
|
$("#" + this.id).parent().off("scroll"); |
|
|
|
this.container.off("scroll"); |
|
|
|
this.hasBinded = false; |
|
|
|
this.hasBinded = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|