2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
books/client/desk/search.js
2018-01-12 17:55:07 +05:30

16 lines
503 B
JavaScript

const frappe = require('frappe-core');
module.exports = class Search {
constructor(parent) {
this.input = frappe.ui.add('input', 'form-control nav-search', parent);
this.input.addEventListener('keypress', function(event) {
if (event.keyCode===13) {
let list = frappe.router.current_page.list;
if (list) {
list.search_text = this.value;
list.run();
}
}
})
}
}