Skip to content

Commit

Permalink
Use get instead of property to keep it more jQuery like.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabacman committed May 23, 2018
1 parent ce12cf3 commit 61ee37c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/Willow-Tests/ScrollIntoViewCommandTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ScrollIntoViewCommandTest >> testModelLoadingActions [

self
assert: html
equals: '<a id="id1"></a><script type="text/javascript">$("#id1").click(function(){$("#id8").each(function(){$(this)[0].scrollIntoView()})});</script>'
equals: '<a id="id1"></a><script type="text/javascript">$("#id1").click(function(){$("#id8").each(function(){$(this).get(0).scrollIntoView()})});</script>'
]

{ #category : #'tests-accessing' }
Expand Down
4 changes: 3 additions & 1 deletion source/Willow/ScrollIntoViewCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 61ee37c

Please sign in to comment.