follow up commit
This commit is contained in:
parent
9f64477585
commit
ad68dcb0a8
|
@ -11,7 +11,7 @@ import {properties} from "../../../../environments/environment";
|
|||
import {StringUtils} from "../../utils/string-utils.class";
|
||||
import {Title} from "@angular/platform-browser";
|
||||
import {AlertModal} from '../../utils/modal/alert';
|
||||
import {MenuItem, MenuItemExtended} from '../../sharedComponents/menu';
|
||||
import {MenuItemExtended} from '../../sharedComponents/menu';
|
||||
import {SearchInputComponent} from '../../sharedComponents/search-input/search-input.component';
|
||||
import {Option} from '../../sharedComponents/input/input.component';
|
||||
import {CommunityInfo} from '../../connect/community/communityInfo';
|
||||
|
@ -226,7 +226,7 @@ export class MenuComponent implements OnInit {
|
|||
this.menuItemsModalOpen('Add Menu Item', 'Create');
|
||||
}
|
||||
|
||||
public editMenuItem(index: number, menuItem: MenuItem, isChild: boolean = false) {
|
||||
public editMenuItem(index: number, menuItem: MenuItemExtended, isChild: boolean = false) {
|
||||
this.menuItemForm = this._fb.group({
|
||||
_id: this._fb.control(menuItem['_id']),
|
||||
title: this._fb.control(menuItem.title,Validators.required),
|
||||
|
@ -234,7 +234,7 @@ export class MenuComponent implements OnInit {
|
|||
route: this._fb.control(menuItem.route, (menuItem['type'] == "internal") ? [Validators.required] : []),
|
||||
url: this._fb.control(menuItem.url, (menuItem['type'] == "external") ? [Validators.required, StringUtils.urlValidator()] : []),
|
||||
isFeatured: this._fb.control(menuItem.isFeatured),
|
||||
parentItemId: this._fb.control(menuItem['parentItemId'])
|
||||
parentItemId: this._fb.control(menuItem.parentItemId)
|
||||
});
|
||||
this.isChild = isChild;
|
||||
this.index = index;
|
||||
|
@ -326,8 +326,8 @@ export class MenuComponent implements OnInit {
|
|||
|
||||
public menuItemSavedSuccessfully(menuItem: MenuItemExtended, isNew: boolean) {
|
||||
if(isNew) {
|
||||
if(menuItem['parentItemId']) {
|
||||
let i = this.normalMenuItems.findIndex(_ => _._id == menuItem['parentItemId']);
|
||||
if(menuItem.parentItemId) {
|
||||
let i = this.normalMenuItems.findIndex(_ => _._id == menuItem.parentItemId);
|
||||
this.normalMenuItems[i].items.push(menuItem);
|
||||
} else {
|
||||
if(menuItem.isFeatured) {
|
||||
|
@ -338,7 +338,7 @@ export class MenuComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if(menuItem['parentItemId']) {
|
||||
if(menuItem.parentItemId) {
|
||||
} else {
|
||||
if(menuItem.isFeatured) {
|
||||
this.featuredMenuItems[this.index] = menuItem;
|
||||
|
|
Loading…
Reference in New Issue