From d7aedeab014342cce8eda23861a3d18c4f5a9a57 Mon Sep 17 00:00:00 2001 From: valtena Date: Mon, 7 Mar 2022 09:45:27 +0100 Subject: [PATCH] fix: mdllist cache --- .../MDLNestedList.class.st | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Material-Design-Lite-Widgets/MDLNestedList.class.st b/src/Material-Design-Lite-Widgets/MDLNestedList.class.st index 6cd56814..3e5fae15 100644 --- a/src/Material-Design-Lite-Widgets/MDLNestedList.class.st +++ b/src/Material-Design-Lite-Widgets/MDLNestedList.class.st @@ -451,7 +451,17 @@ MDLNestedList >> obtainElementForPath: aPath [ { #category : #private } MDLNestedList >> obtainTreeFor: anElement [ - ^ obtainedTreesCache at: anElement ifAbsentPut: [ MDLNestedListTreeNode list: self element: anElement ] + ^ self obtainedTreesCache at: anElement ifAbsentPut: [ MDLNestedListTreeNode list: self element: anElement ] +] + +{ #category : #accessing } +MDLNestedList >> obtainedTreesCache [ + ^ obtainedTreesCache ifNil: [ obtainedTreesCache := IdentityDictionary new ] +] + +{ #category : #accessing } +MDLNestedList >> obtainedTreesCache: anObject [ + obtainedTreesCache := anObject ] { #category : #accessing } @@ -519,7 +529,7 @@ MDLNestedList >> printSublistFor: anIntervalRequest context: aContext on: stream { #category : #rendering } MDLNestedList >> renderContentOn: html [ self ensureId: html. - obtainedTreesCache := IdentityDictionary new. "Reset cache while loading page." + self obtainedTreesCache: nil. "Reset cache while loading page." html div id: (self idFor: #nestedList); class: #nestedList;