mirror of
https://github.com/frappe/books.git
synced 2024-12-23 19:39:07 +00:00
Show items on Link focus (#83)
This commit is contained in:
parent
6ada1a8648
commit
4c0e85aaec
@ -17,15 +17,23 @@ export default {
|
||||
methods: {
|
||||
getInputListeners() {
|
||||
return {
|
||||
input: async e => {
|
||||
this.awesomplete.list = await this.getList(e.target.value);
|
||||
input: e => {
|
||||
this.updateList(e.target.value);
|
||||
},
|
||||
'awesomplete-select': e => {
|
||||
const value = e.text.value;
|
||||
this.handleChange(value);
|
||||
},
|
||||
focus: async e => {
|
||||
await this.updateList();
|
||||
this.awesomplete.evaluate();
|
||||
this.awesomplete.open();
|
||||
}
|
||||
}
|
||||
},
|
||||
async updateList(value) {
|
||||
this.awesomplete.list = await this.getList(value);
|
||||
},
|
||||
getList(text) {
|
||||
return this.docfield.getList(text);
|
||||
},
|
||||
@ -46,11 +54,9 @@ export default {
|
||||
return li;
|
||||
}
|
||||
});
|
||||
|
||||
this.bindEvents();
|
||||
},
|
||||
bindEvents() {
|
||||
|
||||
},
|
||||
sort() {
|
||||
// return a function that handles sorting of items
|
||||
|
@ -18,9 +18,9 @@ export default {
|
||||
async getList(query) {
|
||||
const list = await frappe.db.getAll({
|
||||
doctype: this.getTarget(),
|
||||
filters: {
|
||||
filters: query ? {
|
||||
keywords: ['like', query]
|
||||
},
|
||||
} : null,
|
||||
fields: ['name'],
|
||||
limit: 50
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user