From 53d96dc61b7cee5729f5cab8f7a2117384e5fcc9 Mon Sep 17 00:00:00 2001
From: Hermann <blumh@student.ethz.ch>
Date: Sat, 5 May 2018 09:46:27 +0200
Subject: [PATCH] fix table scrolling after update of polythene and
 mithril-infinite

---
 package.json            | 8 ++++----
 src/groups/viewGroup.js | 2 ++
 src/views/selectList.js | 2 +-
 src/views/tableView.js  | 6 ++++--
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/package.json b/package.json
index 0d0c632..8cd65bb 100644
--- a/package.json
+++ b/package.json
@@ -20,10 +20,10 @@
     "axios": "^0.17.1",
     "client-oauth2": "^4.2.0",
     "mithril": "^1.1.6",
-    "mithril-infinite": "^1.2.0",
-    "polythene-core-css": "^1.0.0",
-    "polythene-css": "^1.0.0",
-    "polythene-mithril": "^1.0.0",
+    "mithril-infinite": "^1.2.4",
+    "polythene-core-css": "^1.2.0",
+    "polythene-css": "^1.2.0",
+    "polythene-mithril": "^1.2.0",
     "querystring": "^0.2.0"
   },
   "devDependencies": {
diff --git a/src/groups/viewGroup.js b/src/groups/viewGroup.js
index 0f10de4..0ed9a32 100644
--- a/src/groups/viewGroup.js
+++ b/src/groups/viewGroup.js
@@ -60,12 +60,14 @@ class MembersTable {
               group: this.group_id,
             }).then(() => {
               this.ctrl.refresh();
+              m.redraw();
             });
           },
           onCancel: () => { this.addmode = false; m.redraw(); },
           selectedText: user => `${user.firstname} ${user.lastname}`,
         }) : '',
         m(TableView, {
+          tableHeight: '420px',
           controller: this.ctrl,
           keys: ['user.lastname', 'user.firstname', 'user.email'],
           tileContent: data => this.itemRow(data),
diff --git a/src/views/selectList.js b/src/views/selectList.js
index 3dd17fa..ed2f98d 100644
--- a/src/views/selectList.js
+++ b/src/views/selectList.js
@@ -146,7 +146,7 @@ export default class SelectList {
         defaultValue: '',
       })),
       (this.showList && !this.selected) ? m(List, {
-        className: 'scrollTable',
+        style: { height: '400px' },
         tiles: m(infinite, controller.infiniteScrollParams(this.item())),
       }) : null,
     ]);
diff --git a/src/views/tableView.js b/src/views/tableView.js
index 91ef8be..d9b8b48 100644
--- a/src/views/tableView.js
+++ b/src/views/tableView.js
@@ -10,7 +10,8 @@ const tableStyles = [
     '.tabletool': {
       display: 'grid',
       height: '100%',
-      'grid-template-rows': '48px calc(100% - 48px)',
+      'grid-template-rows': '48px calc(100% - 78px)',
+      'background-color': 'white',
     },
     '.toolbar': {
       'grid-row': 1,
@@ -18,7 +19,6 @@ const tableStyles = [
     },
     '.scrollTable': {
       'grid-row': 2,
-      'background-color': 'white',
     },
     '.tableTile': {
       padding: '10px',
@@ -84,6 +84,7 @@ export default class TableView {
       controller,
       titles,
       onAdd = () => {},
+      tableHeight = false,
     },
   }) {
     const updateList = debounce(() => {
@@ -115,6 +116,7 @@ export default class TableView {
       }),
       m(List, {
         className: 'scrollTable',
+        style: tableHeight ? { height: tableHeight } : {},
         tiles: [
           m(ListTile, {
             className: 'tableTile',
-- 
GitLab