Rename base_page to subpage

This commit is contained in:
Faris Ansari 2018-08-01 15:57:13 +05:30
parent fbe9a46d51
commit de85f24383
10 changed files with 19 additions and 9 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -1,4 +1,4 @@
import SubPage from './base_page';
import SubPage from './subpage';
erpnext.hub.NotFound = class NotFound extends SubPage {
refresh() {

View File

@ -1,4 +1,4 @@
import SubPage from './base_page';
import SubPage from './subpage';
erpnext.hub.Profile = class Profile extends SubPage {
make_wrapper() {

View File

@ -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 {

View File

@ -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 {

View File

@ -1,4 +1,4 @@
import SubPage from './base_page';
import SubPage from './subpage';
erpnext.hub.Register = class Register extends SubPage {
make_wrapper() {

View File

@ -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 {

View File

@ -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);