brotherton-erpnext/erpnext/public/js/hub/pages/favourites.js

21 lines
484 B
JavaScript
Raw Normal View History

2018-08-01 10:27:13 +00:00
import SubPage from './subpage';
import { get_item_card_container_html } from '../helpers';
erpnext.hub.Favourites = class Favourites extends SubPage {
refresh() {
this.get_favourites()
.then(items => {
this.render(items);
});
}
get_favourites() {
return hub.call('get_item_favourites');
}
render(items) {
this.$wrapper.find('.hub-card-container').empty();
const html = get_item_card_container_html(items, __('Favourites'));
this.$wrapper.append(html)
}
}