Rename base_page to subpage
This commit is contained in:
parent
fbe9a46d51
commit
de85f24383
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
import { get_item_card_container_html } from '../helpers';
|
||||
|
||||
erpnext.hub.Category = class Category extends SubPage {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
import { get_item_card_container_html } from '../helpers';
|
||||
|
||||
erpnext.hub.Favourites = class Favourites extends SubPage {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
import { make_search_bar, get_item_card_container_html } from '../helpers';
|
||||
|
||||
erpnext.hub.Home = class Home extends SubPage {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
|
||||
erpnext.hub.NotFound = class NotFound extends SubPage {
|
||||
refresh() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
|
||||
erpnext.hub.Profile = class Profile extends SubPage {
|
||||
make_wrapper() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
import { make_search_bar, get_item_card_container_html, get_local_item_card_html } from '../helpers';
|
||||
|
||||
erpnext.hub.Publish = class Publish extends SubPage {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
import { get_item_card_container_html } from '../helpers';
|
||||
|
||||
erpnext.hub.PublishedProducts = class PublishedProducts extends SubPage {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
|
||||
erpnext.hub.Register = class Register extends SubPage {
|
||||
make_wrapper() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import SubPage from './base_page';
|
||||
import SubPage from './subpage';
|
||||
import { make_search_bar, get_item_card_container_html } from '../helpers';
|
||||
|
||||
erpnext.hub.SearchPage = class SearchPage extends SubPage {
|
||||
|
@ -3,6 +3,16 @@ export default class SubPage {
|
||||
this.$parent = $(parent);
|
||||
this.make_wrapper(options);
|
||||
|
||||
// generic action handler
|
||||
this.$wrapper.on('click', '[data-action]', e => {
|
||||
const $this = $(e.currentTarget);
|
||||
const action = $this.data().action;
|
||||
|
||||
if (action && this[action]) {
|
||||
this[action].apply(this);
|
||||
}
|
||||
})
|
||||
|
||||
// handle broken images after every render
|
||||
if (this.render) {
|
||||
this._render = this.render.bind(this);
|
Loading…
x
Reference in New Issue
Block a user