|
|
|
@ -14,7 +14,7 @@ |
|
|
|
/// limitations under the License.
|
|
|
|
///
|
|
|
|
|
|
|
|
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'; |
|
|
|
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core'; |
|
|
|
import { PageComponent } from '@shared/components/page.component'; |
|
|
|
import { WidgetContext } from '@home/models/widget-component.models'; |
|
|
|
import { UtilsService } from '@core/services/utils.service'; |
|
|
|
@ -55,11 +55,11 @@ interface SwitchSettings { |
|
|
|
templateUrl: './switch.component.html', |
|
|
|
styleUrls: ['./switch.component.scss'] |
|
|
|
}) |
|
|
|
export class SwitchComponent extends PageComponent implements OnInit, AfterViewInit, OnDestroy { |
|
|
|
export class SwitchComponent extends PageComponent implements AfterViewInit, OnDestroy { |
|
|
|
|
|
|
|
@ViewChild('switch', {static: false}) switchElementRef: ElementRef<HTMLElement>; |
|
|
|
@ViewChild('switchContainer', {static: false}) switchContainerRef: ElementRef<HTMLElement>; |
|
|
|
@ViewChild('matSlideToggle', {static: false}) matSlideToggleRef: MatSlideToggle; |
|
|
|
@ViewChild('matSlideToggle', {static: false, read: ElementRef}) matSlideToggleRef: ElementRef<HTMLElement>; |
|
|
|
@ViewChild('onoffContainer', {static: false}) onoffContainerRef: ElementRef<HTMLElement>; |
|
|
|
@ViewChild('onLabel', {static: false}) onLabelRef: ElementRef<HTMLElement>; |
|
|
|
@ViewChild('offLabel', {static: false}) offLabelRef: ElementRef<HTMLElement>; |
|
|
|
@ -119,14 +119,11 @@ export class SwitchComponent extends PageComponent implements OnInit, AfterViewI |
|
|
|
super(store); |
|
|
|
} |
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
} |
|
|
|
|
|
|
|
ngAfterViewInit() { |
|
|
|
if (this.switchType === 'switch') { |
|
|
|
this.switchElement = $(this.switchElementRef.nativeElement); |
|
|
|
this.switchContainer = $(this.switchContainerRef.nativeElement); |
|
|
|
this.matSlideToggle = $(this.matSlideToggleRef._elementRef.nativeElement); |
|
|
|
this.matSlideToggle = $(this.matSlideToggleRef.nativeElement); |
|
|
|
this.onoffContainer = $(this.onoffContainerRef.nativeElement); |
|
|
|
this.onLabel = $(this.onLabelRef.nativeElement); |
|
|
|
this.offLabel = $(this.offLabelRef.nativeElement); |
|
|
|
|