Skip to content

Commit f6ee653

Browse files
emergieVladimir Kotal
authored andcommitted
Revert "Revert "bugfix: #1830 "Type" dropdown field/box missing with non-project mode""
This reverts commit d9cfe49
1 parent 00e20bb commit f6ee653

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

src/org/opensolaris/opengrok/web/Scripts.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public String toHtml() {
125125
SCRIPTS.put("jquery-tablesorter", new FileScript("js/jquery-tablesorter-2.26.6.min.js", 12));
126126
SCRIPTS.put("tablesorter-parsers", new FileScript("js/tablesorter-parsers-0.0.1.js", 13));
127127
SCRIPTS.put("searchable-option-list", new FileScript("js/searchable-option-list-2.0.5.min.js", 14));
128-
SCRIPTS.put("utils", new FileScript("js/utils-0.0.18.js", 15));
128+
SCRIPTS.put("utils", new FileScript("js/utils-0.0.19.js", 15));
129129
SCRIPTS.put("repos", new FileScript("js/repos-0.0.1.js", 20));
130130
SCRIPTS.put("diff", new FileScript("js/diff-0.0.2.js", 20));
131131
}

web/js/utils-0.0.18.js renamed to web/js/utils-0.0.19.js

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,23 @@ function init_results_autohide() {
13171317
}
13181318

13191319
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+
}
13201337
var searchableOptionListOptions = {
13211338
maxHeight: '300px',
13221339
showSelectionBelowList: false,
@@ -1364,27 +1381,16 @@ function init_searchable_option_list() {
13641381
.css('left', Math.floor(this.$container.offset().left))
13651382
.css('width', selectionContainerWidth);
13661383
},
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
13841385
}
13851386
};
13861387

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+
}
13881394
}
13891395

13901396
function init_history_input() {

0 commit comments

Comments
 (0)