diff options
author | Chocobozzz <me@florianbigard.com> | 2021-03-24 10:58:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-03-24 18:18:41 +0100 |
commit | 2e257e36b78b6f6b842f5ed8b4c79514e6e3a208 (patch) | |
tree | 17330548383cc1dad7197ca07e61ffe5223f7759 /client/src/app/shared | |
parent | 74a4d53110ebc073dafeb74a7ac815fe00f4706b (diff) | |
download | PeerTube-2e257e36b78b6f6b842f5ed8b4c79514e6e3a208.tar.gz PeerTube-2e257e36b78b6f6b842f5ed8b4c79514e6e3a208.tar.zst PeerTube-2e257e36b78b6f6b842f5ed8b4c79514e6e3a208.zip |
Add client action hooks for pubish pages
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared-forms/select/select-options.component.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-forms/select/select-options.component.ts b/client/src/app/shared/shared-forms/select/select-options.component.ts index 2890670e5..8482b9dea 100644 --- a/client/src/app/shared/shared-forms/select/select-options.component.ts +++ b/client/src/app/shared/shared-forms/select/select-options.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, forwardRef, Input } from '@angular/core' | 1 | import { Component, forwardRef, HostListener, Input } from '@angular/core' |
2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' | 2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' |
3 | import { SelectOptionsItem } from '../../../../types/select-options-item.model' | 3 | import { SelectOptionsItem } from '../../../../types/select-options-item.model' |
4 | 4 | ||
@@ -26,6 +26,13 @@ export class SelectOptionsComponent implements ControlValueAccessor { | |||
26 | 26 | ||
27 | propagateChange = (_: any) => { /* empty */ } | 27 | propagateChange = (_: any) => { /* empty */ } |
28 | 28 | ||
29 | // Allow plugins to update our value | ||
30 | @HostListener('change', [ '$event.target' ]) | ||
31 | handleChange (event: any) { | ||
32 | this.writeValue(event.value) | ||
33 | this.onModelChange() | ||
34 | } | ||
35 | |||
29 | writeValue (id: number | string) { | 36 | writeValue (id: number | string) { |
30 | this.selectedId = id | 37 | this.selectedId = id |
31 | } | 38 | } |