brotherton-erpnext/erpnext/templates/includes/product_search_box.html
2015-05-27 16:48:06 -04:00

32 lines
909 B
HTML

<script>
frappe.ready(function() {
$(".product-search").remove();
$('<div class="product-search pull-right">\
<form class="form-inline form-search">\
<div class="input-group">\
<input class="form-control" type="text" id="product-search" placeholder="Product Search...">\
<span class="input-group-btn">\
<button class="btn btn-default" type="button" id="btn-product-search">\
<i class="icon-search"></i></button>\
</span>\
</div>\
</form>\
</div>').prependTo(".page-header-block");
$('.dropdown-toggle').dropdown();
$("#btn-product-search").click(function() {
var txt = $("#product-search").val();
if(txt) {
window.location.href="/product_search?q=" + txt;
}
return false;
});
$("#product-search").keypress(function(e) {
if(e.which==13) $("#btn-product-search").click();
});
$(".form-search").on("submit", function() { return false; });
});
</script>