import {Component, Input, SimpleChanges} from '@angular/core'; import {PluginSearchDepositLink} from "./plugin-search-deposit-link.component"; import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.form.component"; @Component({ selector: 'plugin-search-deposit-link-form', template: `
Cards:
{{card.title}}
Change the custom section background options here.
Link #{{j + 1}}
`, }) export class PluginSearchDepositLinkFormComponent extends PluginBaseFormComponent /*implements OnChanges*/ { selectedIndex = -1; @Input() editSubmenuOpen; constructor() { super() } ngOnChanges(changes: SimpleChanges) { if (this.editSubmenuOpen == false && this.selectedIndex > -1) { this.close(); } } cardShowChanged(i, $event: PluginEditEvent) { this.pluginObject.cardInfoArray[i].show = $event.value; $event.value = this.pluginObject.cardInfoArray; this.valuesChanged.emit({field: $event.field, value: $event.value, type: 'parent'}) } cardValueChanged(i, $event: PluginEditEvent) { this.pluginObject.cardInfoArray[i][$event.field] = $event.value; $event.value = this.pluginObject.cardInfoArray; this.valuesChanged.emit({field: "cardInfoArray", value: $event.value, type: 'parent'}) } cardUrlValueChanged(i, j, $event: PluginEditEvent) { if (this.editTemplate) { this.pluginObject.cardInfoArray[i].urlsArray[j][$event.field] = $event.value; $event.value = this.pluginObject.cardInfoArray; } else { this.pluginObject.cardInfoArray[i].urlsArray[j][$event.field] = $event.value; $event.value = this.pluginObject.cardInfoArray; } this.valuesChanged.emit({field: "cardInfoArray", value: $event.value, type: 'parent'}) } edit(i) { this.selectedIndex = i; this.toggleSubMenu(true); } close() { this.selectedIndex = -1; this.toggleSubMenu(false); } }