brotherton-erpnext/erpnext/public/js/hub/hub_factory.js

33 lines
689 B
JavaScript
Raw Normal View History

frappe.provide('erpnext.hub');
2017-12-10 16:32:41 +00:00
frappe.views.marketplaceFactory = class marketplaceFactory extends frappe.views.Factory {
show() {
if (frappe.pages.marketplace) {
frappe.container.change_to('marketplace');
erpnext.hub.marketplace.refresh();
} else {
this.make('marketplace');
}
}
2017-12-10 16:32:41 +00:00
make(page_name) {
const assets = [
'/assets/js/marketplace.min.js'
];
2018-01-25 03:48:32 +00:00
frappe.require(assets, () => {
erpnext.hub.marketplace = new erpnext.hub.Marketplace({
parent: this.make_page(true, page_name)
});
2018-02-15 04:47:07 +00:00
});
2018-07-25 11:21:01 +00:00
}
}
$(document).on('toolbar_setup', () => {
$('#toolbar-user .navbar-reload').after(`
<li>
<a href="#marketplace/home">${__('Marketplace')}
</li>
`)
2018-08-06 08:26:53 +00:00
})