LP2015137 Tab order for admin splash link tables
[evergreen-equinox.git] / Open-ILS / src / eg2 / src / app / staff / share / link-table / link-table.component.ts
index 9b06c92..ae9d0df 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, Input, OnInit, AfterViewInit, Host} from '@angular/core';
+import {Component, Input, OnInit, Host} from '@angular/core';
 
 interface LinkTableLink {
     label: string;
@@ -8,44 +8,23 @@ interface LinkTableLink {
 
 @Component({
     selector: 'eg-link-table',
-    templateUrl: './link-table.component.html'
+    templateUrl: './link-table.component.html',
+    styleUrls: ['link-table.component.css'],
+    styles: [
+    `
+      ul {
+        column-count: var(--columnCount);
+      }
+    `
+    ]
 })
 
-export class LinkTableComponent implements AfterViewInit {
+export class LinkTableComponent {
     @Input() columnCount: number;
     links: LinkTableLink[];
-    rowBuckets: any[];
-    colList: number[];
-    colWidth: number;
 
     constructor() {
         this.links = [];
-        this.rowBuckets = [];
-        this.colList = [];
-    }
-
-    ngAfterViewInit() {
-        // table-ize the links
-        const rowCount = Math.ceil(this.links.length / this.columnCount);
-        this.colWidth = Math.floor(12 / this.columnCount); // Bootstrap 12-grid
-
-        for (let col = 0; col < this.columnCount; col++) {
-            this.colList.push(col);
-        }
-
-        // Modifying values in AfterViewInit without other activity
-        // happening can result in the modified values not getting
-        // displayed until some action occurs.  Modifing after
-        // via timeout works though.
-        setTimeout(() => {
-            for (let row = 0; row < rowCount; row++) {
-                this.rowBuckets[row] = [
-                    this.links[row],
-                    this.links[row + Number(rowCount)],
-                    this.links[row + Number(rowCount * 2)]
-                ];
-            }
-        });
     }
 }