changeset 386:ee6c4e3dc461

Some visibility changes and unnecessary method args.
author Lucas Thompson <dev@lucas.im>
date Wed, 31 May 2017 19:29:51 +0100
parents afe2fa4a3215
children 2ec1e795f46c
files src/app/visualisations/waves-base.component.ts
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/visualisations/waves-base.component.ts	Wed May 31 19:24:21 2017 +0100
+++ b/src/app/visualisations/waves-base.component.ts	Wed May 31 19:29:51 2017 +0100
@@ -52,15 +52,15 @@
   ngAfterViewInit(): void {
     this.height =
       this.trackContainer.nativeElement.getBoundingClientRect().height;
-    this.renderTimeline(this.trackContainer);
+    this.renderTimeline();
     this.update();
   }
 
-  update(): void {
+  private update(): void {
     if (!this.waveTrack || !this.mFeature) {
       return;
     }
-    this.clearTimeline(this.trackContainer);
+    this.clearTimeline();
     const layers = this.featureLayers;
     for (const layer of layers) {
       this.addLayer(layer, this.waveTrack, this.timeline.timeContext);
@@ -71,8 +71,8 @@
   }
 
 
-  protected renderTimeline($el: ElementRef): Timeline {
-    const track: HTMLElement = $el.nativeElement;
+  private renderTimeline(): Timeline {
+    const track: HTMLElement = this.trackContainer.nativeElement;
     track.innerHTML = '';
     if (this.duration >= 0) {
       const width: number = track.getBoundingClientRect().width;
@@ -87,7 +87,7 @@
 
     if ('ontouchstart' in window) {
       attachTouchHandlerBodges(
-        $el.nativeElement,
+        track,
         this.timeline
       );
     }
@@ -95,7 +95,7 @@
   }
 
   // TODO can likely be removed, or use waves-ui methods
-  protected clearTimeline($el: ElementRef): void {
+  private clearTimeline(): void {
     // loop through layers and remove them, waves-ui provides methods for this but it seems to not work properly
     const timeContextChildren = this.timeline.timeContext._children;
     for (const track of this.timeline.tracks) {
@@ -130,10 +130,10 @@
 
 
   // TODO can likely use methods in waves-ui directly
-  protected addLayer(layer: Layer,
-                     track: Track,
-                     timeContext: any,
-                     isAxis: boolean = false): void {
+  private addLayer(layer: Layer,
+                   track: Track,
+                   timeContext: any,
+                   isAxis: boolean = false): void {
     if (!layer.timeContext) {
       layer.setTimeContext(isAxis ?
         timeContext : new Waves.core.LayerTimeContext(timeContext));