Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
34 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
...-Tests.package/BootstrapTypeaheadCommandTest.class/instance/testApplyToOnWithRendering.st
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
.../Willow-Bootstrap-Tests.package/BootstrapTypeaheadCommandTest.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
...trapTypeaheadCommand.class/class/searchingWith.labeledBy.withSelectionDo.configuredBy..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
Instance Creation | ||
searchingWith: aSearchAction labeledBy: aLabelsBlock withSelectionDo: aSelectionCallback configuredBy: aConfigurationBlock | ||
|
||
^ self | ||
searchingWith: aSearchAction | ||
^ self new | ||
initializeSearchingWith: aSearchAction | ||
labeledBy: aLabelsBlock | ||
withSelectionDo: aSelectionCallback | ||
thenRefresh: Optional unused | ||
configuredBy: aConfigurationBlock |
9 changes: 0 additions & 9 deletions
9
...dCommand.class/class/searchingWith.labeledBy.withSelectionDo.thenRefresh.configuredBy..st
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...rapTypeaheadCommand.class/class/searchingWith.labeledBy.withSelectionDo.thenRendering..st
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...ommand.class/class/searchingWith.labeledBy.withSelectionDo.thenRendering.configuredBy..st
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
...strap.package/BootstrapTypeaheadCommand.class/instance/afterSelectFunctionEvaluate.on..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
private | ||
afterSelectFunctionEvaluate: aSelectionCallback on: aCanvas | ||
|
||
| selectedIndexHolder ajax | | ||
|
||
selectedIndexHolder := WAValueHolder new. | ||
ajax := aCanvas jQuery ajax. | ||
ajax | ||
callback: [ :activeItemIndex | selectedIndexHolder contents: activeItemIndex greaseInteger ] value: ((aCanvas jQuery alias: 'activeItem') access: self indexProperty); | ||
script: [ :script | aSelectionCallback value: (searchResults at: selectedIndexHolder contents) ]. | ||
^ ajax asFunction: #('activeItem') |
12 changes: 0 additions & 12 deletions
12
...e/BootstrapTypeaheadCommand.class/instance/afterSelectFunctionEvaluate.thenRefresh.on..st
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
...hSelectionDo.thenRefresh.configuredBy..st → ...abeledBy.withSelectionDo.configuredBy..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
initialization | ||
initializeSearchingWith: aSearchAction labeledBy: aLabelsBlock withSelectionDo: aSelectionCallback thenRefresh: anIdentifiedViewOptional configuredBy: aConfigurationBlock | ||
initializeSearchingWith: aSearchAction labeledBy: aLabelsBlock withSelectionDo: aSelectionCallback configuredBy: aConfigurationBlock | ||
|
||
searchResults := #(). | ||
scriptCommand := ComponentScriptCommand | ||
toExecute: [ :canvas | | ||
| typeahead | | ||
|
||
anIdentifiedViewOptional withContentDo: [ :identifiedView | identifiedView identifyIn: canvas ]. | ||
typeahead := canvas jQuery this bootstrapTypeahead. | ||
typeahead | ||
source: (self searchWith: aSearchAction labels: aLabelsBlock on: canvas); | ||
updater: self updaterFunction; | ||
afterSelect: (self afterSelectFunctionEvaluate: aSelectionCallback thenRefresh: anIdentifiedViewOptional on: canvas). | ||
afterSelect: (self afterSelectFunctionEvaluate: aSelectionCallback on: canvas). | ||
aConfigurationBlock cull: typeahead cull: canvas. | ||
typeahead ] |
4 changes: 2 additions & 2 deletions
4
source/Willow-Bootstrap.package/BootstrapTypeaheadCommand.class/instance/updaterFunction.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
private | ||
updaterFunction | ||
updaterFunction | ||
|
||
^ JSFunction new | ||
arguments: #('item'); | ||
add: ((JSStream this alias: 'item') access: self indexProperty); | ||
add: (JSStream this alias: 'item'); | ||
return: true; | ||
yourself |
19 changes: 8 additions & 11 deletions
19
source/Willow-Bootstrap.package/BootstrapTypeaheadCommand.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
{ | ||
"instance" : { | ||
"initializeSearchingWith:labeledBy:withSelectionDo:configuredBy:" : "GabrielOmarCotelli 9/14/2017 10:01", | ||
"applyTo:on:" : "GabrielOmarCotelli 9/12/2017 16:45", | ||
"initializeSearchingWith:labeledBy:withSelectionDo:thenRefresh:configuredBy:" : "GabrielOmarCotelli 9/13/2017 15:34", | ||
"afterSelectFunctionEvaluate:thenRefresh:on:" : "GabrielOmarCotelli 9/13/2017 15:15", | ||
"responseFunctionName" : "GabrielOmarCotelli 9/13/2017 15:03", | ||
"evaluate:with:using:" : "GabrielOmarCotelli 9/13/2017 15:07", | ||
"searchTermVariable" : "GabrielOmarCotelli 9/13/2017 15:03", | ||
"indexProperty" : "GabrielOmarCotelli 9/13/2017 15:01", | ||
"searchWith:labels:on:" : "GabrielOmarCotelli 9/13/2017 15:07", | ||
"updaterFunction" : "GabrielOmarCotelli 9/13/2017 15:08", | ||
"responseFunctionName" : "GabrielOmarCotelli 9/13/2017 15:03" | ||
"updaterFunction" : "GabrielOmarCotelli 9/14/2017 10:05", | ||
"afterSelectFunctionEvaluate:on:" : "GabrielOmarCotelli 9/14/2017 10:07" | ||
}, | ||
"class" : { | ||
"searchingWith:labeledBy:withSelectionDo:configuredBy:" : "GabrielOmarCotelli 9/13/2017 15:17", | ||
"defaultLabelBlock" : "GabrielOmarCotelli 9/13/2017 15:20", | ||
"searchingWith:labeledBy:withSelectionDo:configuredBy:" : "GabrielOmarCotelli 9/14/2017 10:02", | ||
"searchingWith:withSelectionDo:" : "GabrielOmarCotelli 9/13/2017 15:20", | ||
"searchingWith:labeledBy:withSelectionDo:thenRendering:configuredBy:" : "GabrielOmarCotelli 9/13/2017 15:19", | ||
"defaultLabelBlock" : "GabrielOmarCotelli 9/13/2017 15:20", | ||
"searchingWith:withSelectionDo:configuredBy:" : "GabrielOmarCotelli 9/13/2017 15:21", | ||
"searchingWith:labeledBy:withSelectionDo:" : "GabrielOmarCotelli 9/13/2017 15:21", | ||
"searchingWith:labeledBy:withSelectionDo:thenRefresh:configuredBy:" : "GabrielOmarCotelli 9/13/2017 15:16", | ||
"defaultConfigurationBlock" : "GabrielOmarCotelli 9/13/2017 15:21", | ||
"searchingWith:labeledBy:withSelectionDo:thenRendering:" : "GabrielOmarCotelli 9/13/2017 15:19", | ||
"searchingWith:withSelectionDo:configuredBy:" : "GabrielOmarCotelli 9/13/2017 15:21" | ||
"defaultConfigurationBlock" : "GabrielOmarCotelli 9/13/2017 15:21" | ||
} | ||
} |
Oops, something went wrong.