rename file

This commit is contained in:
Sergey Yarkov 2019-11-27 21:29:07 +03:00
parent f872737a3e
commit 58a41aa82e
6 changed files with 42 additions and 45 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
import { Component } from "../core/component"; import { Component } from "../core/component";
import { apiService } from "../services/api.service"; import { apiService } from "../services/api.service";
import { renderItemsOne } from "../templates/itemsOne.template"; import { renderItemsOne } from "../templates/itemsCategory.template";
import { renderItems } from "../templates/items.template"; import { renderItems } from "../templates/items.template";
export class CategoryComponent extends Component { export class CategoryComponent extends Component {

View File

@ -1,7 +1,7 @@
import { Component } from "../core/component"; import { Component } from "../core/component";
import { apiService } from "../services/api.service"; import { apiService } from "../services/api.service";
import { renderItems } from "../templates/items.template"; import { renderItems } from "../templates/items.template";
import { renderItemsOne } from "../templates/itemsOne.template"; import { renderItemsOne } from "../templates/itemsCategory.template";
export class FilterComponent extends Component { export class FilterComponent extends Component {
constructor(id, {items}) { constructor(id, {items}) {

View File

@ -86,6 +86,7 @@ function addItem(e) {
} }
renderObj(item, this, target); renderObj(item, this, target);
} }
}
function renderObj(obj, context, target) { function renderObj(obj, context, target) {
if (context.cart.length > 0) { if (context.cart.length > 0) {
@ -119,4 +120,3 @@ function addItem(e) {
insertCount('counter', context.cart) insertCount('counter', context.cart)
} }
}; };
}

View File

@ -6,8 +6,6 @@ export class Modal {
this.init(); this.init();
} }
onShow() {}
init() { init() {
this.open.addEventListener('click', openHandler.bind(this)); this.open.addEventListener('click', openHandler.bind(this));
this.close.addEventListener('click', closeHandler.bind(this)); this.close.addEventListener('click', closeHandler.bind(this));
@ -26,7 +24,6 @@ export class Modal {
function openHandler(e) { function openHandler(e) {
this.show(); this.show();
this.onShow(e);
} }
function closeHandler() { function closeHandler() {