From e886f981a00ff20a8564b36247bf50b7481ca49b Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 12 Apr 2020 14:44:00 -0400 Subject: [PATCH] [O] Remove dynamic width, use fixed height instead --- .../course-selection/course-selection.vue | 56 ++++++------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/src/pages/course-selection/course-selection.vue b/src/pages/course-selection/course-selection.vue index b2c6073..1f5a1fd 100644 --- a/src/pages/course-selection/course-selection.vue +++ b/src/pages/course-selection/course-selection.vue @@ -14,15 +14,15 @@ - + - -
+ +
Course List
@@ -30,7 +30,7 @@
-
+
{{course.name}} @@ -57,16 +57,11 @@ directory: any[] = [] loading = true - courseListWidth: number = 10; - /** * Called before rendering */ created() { - // Update width dynamically - window.addEventListener("resize", this.updateWidth); - // Get courses App.http.post('/course-info', {}).then(result => { @@ -84,32 +79,6 @@ }) } - /** - * Called on destroy - */ - destroyed() - { - // Remove width updater - window.removeEventListener("resize", this.updateWidth); - } - - /** - * Called on vue update - */ - updated() - { - this.updateWidth() - } - - /** - * Update header width. (CSS doesn't work) - * https://stackoverflow.com/questions/17011195/positionfixed-and-widthinherit-with-percentage-parent - */ - updateWidth() - { - this.courseListWidth = ( this.$refs.cl).$el.clientWidth - 20; - } - get filteredCourses() { return this.courseInfo.filter(c => c.name.toLowerCase().includes(this.search)) @@ -141,17 +110,18 @@ #course-list { margin-right: 20px; - overflow-y: scroll; - .header + + .padding-fix { - position: fixed; - background: white; - // Fix width issue padding-left: 20px; padding-right: 20px; border-radius: 4px; + } + + .header + { .text { @@ -167,6 +137,12 @@ } } + .list + { + overflow: scroll; + overflow-x: hidden; + height: 377px; + } .item { height: 30px;