seitime-frappe/frappe/templates/includes/search_box.html
Faris Ansari 92e8856588
New Build System: Rollup (#5010)
* JS build working

* Css build working!

* Uglify JS in production

* fix codacy

* Add frappe.commands.popen

* FIx ESLint errors

* Add socket.io to package.json

* ignore subprocess warnings

* Add babel-runtime

* sleep 20 after bench start

* remove set -e

* [FIX] non-shell subprocess call

* [FIX] use shell = False

* split commands
2018-02-20 13:47:48 +05:30

39 lines
1.3 KiB
HTML

<div class="item-search text-muted pull-right">
<div class='input-wrapper'>
<input type="text" class="item-search-input"
placeholder="{{ _("Search") }}" autocomplete="off">
<i class="octicon octicon-search pull-right" style='cursor: pointer;'></i>
</div>
</div>
<div class="clearfix pull-right" style="width:100%;">
<h5 class="item-search-results" style="margin-right: 30px;"></h5>
<p class="pull-right" style="margin-top: -28px;">
<a style="display: none;" href="javascript:history.back();" class="octicon octicon-x text-extra-muted clear" title="{{ _("Clear Search") }}" ></a>
</p>
</div>
<script>
frappe.ready(function() {
if(frappe.utils.get_url_arg("search")) {
var txt = frappe.utils.get_url_arg("search");
$(".item-search-results").html("{{ _('Search results for') }}: " + encodeURIComponent(txt));
$(".item-search").toggle(false);
$(".clear").toggle(true);
}
var thread = null;
function find_result(t) {
var search_link = "{{ search_link or '' }}" || location.pathname;
window.location.href=search_link + "?search=" + t;
}
$(".item-search-input").keyup(function(e) {
if(e.which===13) {
find_result($(this).val());
}
});
$('.octicon-search').on('click', function() {
find_result($(".item-search-input").val());
})
$(".form-search").on("submit", function() { return false; });
});
</script>