File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -205,14 +205,20 @@ define([
205
205
return ;
206
206
}
207
207
208
- let widget = instantsearch . widgets [ type ] ;
208
+ search . addWidgets ( [ this . getConfiguredWidget ( instantsearch . widgets [ type ] , config ) ] ) ;
209
+ } ,
209
210
211
+ /**
212
+ * Return a fully configured widget, panelized (as needed) based on the supplied raw config object
213
+ * @param widget
214
+ * @param config
215
+ */
216
+ getConfiguredWidget ( widget , config ) {
210
217
if ( config . panelOptions ) {
211
218
widget = instantsearch . widgets . panel ( config . panelOptions ) ( widget ) ;
212
219
delete config . panelOptions ; // facet config attribute only NOT IS widget attribute
213
220
}
214
-
215
- search . addWidgets ( [ widget ( config ) ] ) ;
221
+ return widget ( config ) ;
216
222
} ,
217
223
218
224
/**
@@ -231,11 +237,13 @@ define([
231
237
const widget = instantsearch . widgets [ type ] ;
232
238
// The dynamicWidgets container must be derived at run time
233
239
return container => {
234
- const newConfig = {
235
- ...raw ,
236
- container
237
- } ;
238
- return widget ( newConfig ) ;
240
+ return this . getConfiguredWidget (
241
+ widget ,
242
+ {
243
+ ...raw ,
244
+ container
245
+ }
246
+ ) ;
239
247
} ;
240
248
} )
241
249
} )
You can’t perform that action at this time.
0 commit comments