brotherton-erpnext/erpnext/templates/includes/product_search_box.html
2014-04-21 22:10:43 +05:30

32 lines
896 B
HTML

<script>
frappe.ready(function() {
$(".product-search").remove();
$('<div class="product-search">\
<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>').appendTo(".page-header-right");
$('.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>