From ce12cf3d0f4523c2ac8deabab119d66c6af66266 Mon Sep 17 00:00:00 2001 From: Maximiliano Tabacman Date: Tue, 22 May 2018 23:12:37 -0300 Subject: [PATCH 1/2] Forced ScrollIntoViewCommand to dereference the iterated items before calling the scrollIntoView function. --- source/Willow-Tests/ScrollIntoViewCommandTest.class.st | 2 +- source/Willow/ScrollIntoViewCommand.class.st | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/Willow-Tests/ScrollIntoViewCommandTest.class.st b/source/Willow-Tests/ScrollIntoViewCommandTest.class.st index e8940cdd..2224b100 100644 --- a/source/Willow-Tests/ScrollIntoViewCommandTest.class.st +++ b/source/Willow-Tests/ScrollIntoViewCommandTest.class.st @@ -39,7 +39,7 @@ ScrollIntoViewCommandTest >> testModelLoadingActions [ self assert: html - equals: '' + equals: '' ] { #category : #'tests-accessing' } diff --git a/source/Willow/ScrollIntoViewCommand.class.st b/source/Willow/ScrollIntoViewCommand.class.st index bd9f43cd..b72eca17 100644 --- a/source/Willow/ScrollIntoViewCommand.class.st +++ b/source/Willow/ScrollIntoViewCommand.class.st @@ -23,13 +23,13 @@ ScrollIntoViewCommand >> clientIndependentActions [ ^#() ] -{ #category : #'accessing - private' } +{ #category : #'private - accessing' } ScrollIntoViewCommand >> identifierToShow [ ^identifierProvider value ] -{ #category : #'initialize-release' } +{ #category : #initialization } ScrollIntoViewCommand >> initializeWithComponentIdentifierProvidedBy: anIdentifierProvider [ identifierProvider := anIdentifierProvider @@ -39,7 +39,9 @@ ScrollIntoViewCommand >> initializeWithComponentIdentifierProvidedBy: anIdentifi ScrollIntoViewCommand >> modelLoadingActions [ ^ Array - with: [ :aScript :aCanvas | aScript << (aCanvas jQuery id: self identifierToShow) each: (aCanvas jQuery this call: 'scrollIntoView') ] + with: [ :aScript :aCanvas | + aScript << (aCanvas jQuery id: self identifierToShow) + each: ((aCanvas jQuery this property: 0) call: 'scrollIntoView') ] ] { #category : #accessing } From 61ee37cd88c4d28cd508dc0d2ff8c54f7bee0e98 Mon Sep 17 00:00:00 2001 From: Maximiliano Tabacman Date: Wed, 23 May 2018 08:47:02 -0300 Subject: [PATCH 2/2] Use get instead of property to keep it more jQuery like. --- source/Willow-Tests/ScrollIntoViewCommandTest.class.st | 2 +- source/Willow/ScrollIntoViewCommand.class.st | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/Willow-Tests/ScrollIntoViewCommandTest.class.st b/source/Willow-Tests/ScrollIntoViewCommandTest.class.st index 2224b100..fee9d94e 100644 --- a/source/Willow-Tests/ScrollIntoViewCommandTest.class.st +++ b/source/Willow-Tests/ScrollIntoViewCommandTest.class.st @@ -39,7 +39,7 @@ ScrollIntoViewCommandTest >> testModelLoadingActions [ self assert: html - equals: '' + equals: '' ] { #category : #'tests-accessing' } diff --git a/source/Willow/ScrollIntoViewCommand.class.st b/source/Willow/ScrollIntoViewCommand.class.st index b72eca17..d5df3400 100644 --- a/source/Willow/ScrollIntoViewCommand.class.st +++ b/source/Willow/ScrollIntoViewCommand.class.st @@ -38,10 +38,12 @@ ScrollIntoViewCommand >> initializeWithComponentIdentifierProvidedBy: anIdentifi { #category : #accessing } ScrollIntoViewCommand >> modelLoadingActions [ + "We iterate the result before sending the scrolling message in case no match is found." + ^ Array with: [ :aScript :aCanvas | aScript << (aCanvas jQuery id: self identifierToShow) - each: ((aCanvas jQuery this property: 0) call: 'scrollIntoView') ] + each: ((aCanvas jQuery this get: 0) call: 'scrollIntoView') ] ] { #category : #accessing }