Remove default align values
authorStephanie Leary <stephanie.leary@equinoxoli.org>
Fri, 17 Mar 2023 16:39:05 +0000 (16:39 +0000)
committerStephanie Leary <stephanie.leary@equinoxoli.org>
Fri, 17 Mar 2023 16:39:05 +0000 (16:39 +0000)
Signed-off-by: Stephanie Leary <stephanie.leary@equinoxoli.org>
Open-ILS/src/eg2/src/app/share/grid/grid.ts

index efc253f..b2e16fa 100644 (file)
@@ -327,7 +327,7 @@ export class GridColumnSet {
         this.columns.forEach(col => {
             col.flex = 2;
             col.sort = 0;
-            col.align = 'left';
+            col.align = '';
             col.visible = this.stockVisible.includes(col.name);
         });
     }
@@ -350,7 +350,7 @@ export class GridColumnSet {
 
         if (!col.name) { col.name = col.path; }
         if (!col.flex) { col.flex = 2; }
-        if (!col.align) { col.align = 'left'; }
+        if (!col.align) { col.align = ''; }
         if (!col.label) { col.label = col.name; }
         if (!col.datatype) { col.datatype = 'text'; }
         if (!col.isAuto) { col.headerLabel = col.label; }
@@ -461,7 +461,7 @@ export class GridColumnSet {
         // scrunch the data down to just the needed info.
         return this.displayColumns().map(col => {
             const c: GridColumnPersistConf = {name : col.name};
-            if (col.align !== 'left') { c.align = col.align; }
+            if (col.align !== '') { c.align = col.align; }
             if (col.flex !== 2) { c.flex = Number(col.flex); }
             if (Number(col.sort)) { c.sort = Number(col.sort); }
             return c;
@@ -1361,10 +1361,13 @@ export class GridContext {
         switch (col.align) {
             case "left":
                 classes.push('text-start');
+                break;
             case "right":
                 classes.push('text-end');
+                break;
             case "center":
                 classes.push('text-center');
+                break;
         }
 
         /* Base classes */