brotherton-erpnext/erpnext/public/js/hub/pages/favourites.js
2018-08-01 15:57:13 +05:30

21 lines
484 B
JavaScript

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)
}
}