@@ -1317,6 +1317,23 @@ function init_results_autohide() {
1317
1317
}
1318
1318
1319
1319
function init_searchable_option_list ( ) {
1320
+ function init_sol_on_type_combobox ( ) {
1321
+ /**
1322
+ * Has to be here because otherwise the offset()
1323
+ * takes the original long <select> box and the max-height
1324
+ * does not work then.
1325
+ */
1326
+ $ ( '#type' ) . searchableOptionList ( {
1327
+ texts : {
1328
+ searchplaceholder : 'Click here to restrict the file type'
1329
+ } ,
1330
+ maxHeight : $ ( '#type' ) . offset ( ) . top + 'px' ,
1331
+ /**
1332
+ * Defined in menu.jsp just next to the original <select>
1333
+ */
1334
+ resultsContainer : $ ( "#type-select-container" )
1335
+ } ) ;
1336
+ }
1320
1337
var searchableOptionListOptions = {
1321
1338
maxHeight : '300px' ,
1322
1339
showSelectionBelowList : false ,
@@ -1364,27 +1381,16 @@ function init_searchable_option_list() {
1364
1381
. css ( 'left' , Math . floor ( this . $container . offset ( ) . left ) )
1365
1382
. css ( 'width' , selectionContainerWidth ) ;
1366
1383
} ,
1367
- onRendered : function ( ) {
1368
- /**
1369
- * Has to be here because otherwise the offset()
1370
- * takes the original long <select> box and the max-height
1371
- * does not work then.
1372
- */
1373
- $ ( '#type' ) . searchableOptionList ( {
1374
- texts : {
1375
- searchplaceholder : 'Click here to restrict the file type'
1376
- } ,
1377
- maxHeight : $ ( '#type' ) . offset ( ) . top + 'px' ,
1378
- /**
1379
- * Defined in menu.jsp just next to the original <select>
1380
- */
1381
- resultsContainer : $ ( "#type-select-container" ) ,
1382
- } ) ;
1383
- }
1384
+ onRendered : init_sol_on_type_combobox
1384
1385
}
1385
1386
} ;
1386
1387
1387
- $ ( '#project' ) . searchableOptionList ( searchableOptionListOptions ) ;
1388
+ var $project = $ ( '#project' ) ;
1389
+ if ( $project . length === 1 ) {
1390
+ $project . searchableOptionList ( searchableOptionListOptions ) ;
1391
+ } else {
1392
+ init_sol_on_type_combobox ( ) ;
1393
+ }
1388
1394
}
1389
1395
1390
1396
function init_history_input ( ) {
0 commit comments