fix: search_box_id instead of search_box_class
This commit is contained in:
parent
6583a83dd3
commit
02d92070be
@ -1,10 +1,10 @@
|
||||
erpnext.ProductSearch = class {
|
||||
constructor(opts) {
|
||||
/* Options: search_box_class (for custom search box) */
|
||||
/* Options: search_box_id (for custom search box) */
|
||||
$.extend(this, opts);
|
||||
this.MAX_RECENT_SEARCHES = 4;
|
||||
this.search_box_class = this.search_box_class || "#search-box";
|
||||
this.searchBox = $(this.search_box_class);
|
||||
this.search_box_id = this.search_box_id || "#search-box";
|
||||
this.searchBox = $(this.search_box_id);
|
||||
|
||||
this.setupSearchDropDown();
|
||||
this.bindSearchAction();
|
||||
@ -27,7 +27,7 @@ erpnext.ProductSearch = class {
|
||||
// If click occurs outside search input/results, hide results.
|
||||
// Click can happen anywhere on the page
|
||||
$("body").on("click", (e) => {
|
||||
let searchEvent = $(e.target).closest(this.search_box_class).length;
|
||||
let searchEvent = $(e.target).closest(this.search_box_id).length;
|
||||
let resultsEvent = $(e.target).closest('#search-results-container').length;
|
||||
let isResultHidden = this.search_dropdown.hasClass("hidden");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user