Created
March 31, 2020 17:44
-
-
Save leoiamele/cd52b4bb7c3700496d148eaab990cdbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
console.log('LOAD AUTO') | |
$input = $("#search_head"); | |
var options = { | |
getValue: "title", | |
url: function(phrase){ | |
return "/search?q=" + phrase; | |
}, | |
categories: [ | |
{ | |
listLocation: "items", | |
header: "<strong>Productos</strong>", | |
}], | |
list:{ | |
onChooseEvent: function(){ | |
var url = $input.getSelectedItemData().url | |
console.log($input) | |
console.log($input.getSelectedItemData()) | |
console.log(url) | |
$input.val("") | |
window.location = url | |
} | |
} | |
} | |
$input.easyAutocomplete(options) | |
$input = $("#search_scroll"); | |
var options = { | |
getValue: "title", | |
url: function(phrase){ | |
return "/search?q=" + phrase; | |
}, | |
categories: [ | |
{ | |
listLocation: "items", | |
header: "<strong>Productos</strong>", | |
}], | |
list:{ | |
onChooseEvent: function(){ | |
var url = $input.getSelectedItemData().url | |
console.log($input) | |
console.log($input.getSelectedItemData()) | |
console.log(url) | |
$input.val("") | |
window.location = url | |
} | |
} | |
} | |
$input.easyAutocomplete(options) | |
$input = $("#sidebar"); | |
var options = { | |
getValue: "title", | |
url: function(phrase){ | |
return "/search?q=" + phrase; | |
}, | |
categories: [ | |
{ | |
listLocation: "items", | |
header: "<strong>Productos</strong>", | |
}], | |
list:{ | |
onChooseEvent: function(){ | |
var url = $input.getSelectedItemData().url | |
console.log($input) | |
console.log($input.getSelectedItemData()) | |
console.log(url) | |
$input.val("") | |
} | |
} | |
} | |
$input.easyAutocomplete(options) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment