2016-03-29 05:51:42 +00:00
|
|
|
<div class="project-search text-muted pull-right">
|
2017-04-12 09:01:57 +00:00
|
|
|
<input type="text" id="project-search" placeholder="Quick Search">
|
|
|
|
<i class="octicon octicon-search"></i>
|
2016-03-29 05:51:42 +00:00
|
|
|
</div>
|
|
|
|
<div class="clearfix pull-right" style="width:300px;">
|
2017-04-12 09:01:57 +00:00
|
|
|
<h4 class="project-search-results pull-left"></h4>
|
|
|
|
<p class="pull-right">
|
|
|
|
<a style="display: none; padding-left:5px;" href="/projects?project={{doc.name}}" class="octicon octicon-x text-extra-muted clear" title="Clear Search" ></a>
|
|
|
|
</p>
|
2016-03-16 12:31:22 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
frappe.ready(function() {
|
2016-03-29 05:51:42 +00:00
|
|
|
if(get_url_arg("q")){
|
|
|
|
var txt = get_url_arg("q");
|
2017-04-12 09:01:57 +00:00
|
|
|
$(".project-search-results").html("Search results for : " + encodeURIComponent(txt));
|
2016-03-29 05:51:42 +00:00
|
|
|
$(".clear").toggle(true);
|
|
|
|
}
|
2016-03-16 12:31:22 +00:00
|
|
|
var thread = null;
|
|
|
|
function findResult(t) {
|
|
|
|
window.location.href="/projects?project={{doc.name}}&q=" + t;
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#project-search").keyup(function() {
|
|
|
|
clearTimeout(thread);
|
|
|
|
var $this = $(this); thread = setTimeout(function(){findResult($this.val())}, 1000);
|
|
|
|
});
|
|
|
|
$(".form-search").on("submit", function() { return false; });
|
|
|
|
});
|
|
|
|
</script>
|