lib/sdoc/generator/template/direct/resources/js/searchdoc.js in voloko-sdoc-0.2.10.1 vs lib/sdoc/generator/template/direct/resources/js/searchdoc.js in voloko-sdoc-0.2.11
- old
+ new
@@ -340,12 +340,13 @@
this.initNavigation();
this.setNavigationActive(false);
}
- this.search = function(value) {
+ this.search = function(value, selectFirstMatch) {
value = jQuery.trim(value).toLowerCase();
+ this.selectFirstMatch = selectFirstMatch;
if (value) {
this.$element.removeClass('panel_tree').addClass('panel_results');
this.tree.setNavigationActive(false);
this.setNavigationActive(true);
} else {
@@ -371,9 +372,10 @@
};
if (this.firstRun && results.length > 0) {
this.firstRun = false;
this.$current = $(target.firstChild);
this.$current.addClass('current');
+ if (this.selectFirstMatch) this.select();
scrollIntoView(this.$current[0], this.$view[0])
}
if (jQuery.browser.msie) this.$element[0].className += '';
}