Recursively call _clearBoundsCache

If the cache for an item's children is not valid anymore, that needs to propagate up the DOM tree.
This commit is contained in:
Jürg Lehni 2011-11-28 23:13:31 +01:00
parent 853263263e
commit cb8c94ef7e

View file

@ -1392,8 +1392,15 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
_clearBoundsCache: function() {
if (this._boundsCache) {
for (var i = 0, list = this._boundsCache.list, l = list.length;
i < l; i++)
delete list[i]._bounds;
i < l; i++) {
var item = list[i];
delete item._bounds;
// We need to recursively call _clearBoundsCache, because if
// the cache for this item's children is not valid anymore,
// that propagates up the DOM tree.
if (item != this && item._boundsCache)
item._clearBoundsCache();
}
delete this._boundsCache;
}
},