Skip to content

Commit

Permalink
fix: mdllist cache
Browse files Browse the repository at this point in the history
  • Loading branch information
LesageYann committed Mar 7, 2022
1 parent 4ad420f commit d7aedea
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Material-Design-Lite-Widgets/MDLNestedList.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d7aedea

Please sign in to comment.