Skip to content

Commit a68613d

Browse files
authored
Merge pull request #73 from SourceCodeOER/fix_front
Fix front
2 parents 8b81060 + d87fd0e commit a68613d

File tree

6 files changed

+2937
-2580
lines changed

6 files changed

+2937
-2580
lines changed

components/Panel/Item/FilterPanel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
/**
148148
* The current opened tag selecter component
149149
*/
150-
selectedTagSelecter: CheckBoxSelecter | undefined = undefined;
150+
selectedTagSelecter: CheckBoxSelecter | RadioButtonSelecter | undefined = undefined;
151151
/**
152152
* If active, the input form is displayed to let the user enters the name of the favorite
153153
*/
@@ -406,7 +406,7 @@
406406
* Save the current tagSelecter or close a tag selecter if previously activated
407407
* @param tagSelecter
408408
*/
409-
toggleList(tagSelecter: CheckBoxSelecter) {
409+
toggleList(tagSelecter: CheckBoxSelecter | RadioButtonSelecter) {
410410
if (this.selectedTagSelecter !== undefined) {
411411
// @ts-ignore
412412
this.selectedTagSelecter.closeList();

components/Panel/Panel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
128128
.panel__main {
129129
.panel__nav__wrapper {
130-
position: sticky;
130+
position: absolute;
131131
top: 0;
132132
left: 0;
133133
right: 0;

components/Panel/PanelItem.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<style lang="scss" scoped>
5656
.panel__item {
5757
height: calc(100% - 50px);
58+
margin-top: 50px;
5859
overflow-y: scroll;
5960
overflow-x: hidden;
6061
}

components/Search/RadioButtonSelecter.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Icon type="arrowRight"/>
55
<slot></slot>
66
</span>
7-
<ul :class="{active}">
7+
<ul :class="{active}" ref="list">
88
<li>
99
<input type="text" class="input--primary-color" v-model="filter" placeholder="Filtrer">
1010
</li>
@@ -27,7 +27,7 @@
2727
</template>
2828

2929
<script lang="ts">
30-
import {Vue, Component, Prop, Emit, Watch} from "vue-property-decorator";
30+
import {Vue, Component, Prop, Emit, Watch, Ref} from "vue-property-decorator";
3131
import Icon from "~/components/Symbols/Icon.vue";
3232
import {RadiobuttonObject, RadiobuttonSelecterObjectEmitted} from "~/types";
3333
@@ -43,6 +43,8 @@
4343
@Prop({type: Array, required: true}) readonly defaultOptions!: RadiobuttonObject[];
4444
@Prop({default: 'default'}) readonly defaultValue!: any;
4545
@Prop({type: Boolean, default: false}) readonly selectDefaultOption!: boolean;
46+
@Ref() list!: HTMLElement;
47+
4648
4749
selectedValue: any = this.defaultValue;
4850
@@ -78,8 +80,21 @@
7880
}
7981
8082
@Emit()
81-
toggleList() {
83+
toggleList(): RadioButtonSelecter {
8284
this.active = !this.active;
85+
86+
if(this.active) {
87+
this.list.style.maxHeight = this.list.scrollHeight.toString() + "px";
88+
} else {
89+
this.list.style.maxHeight = "0";
90+
}
91+
92+
return this
93+
}
94+
95+
closeList(): RadioButtonSelecter {
96+
this.active = false;
97+
this.list.style.maxHeight = "0";
8398
return this
8499
}
85100

0 commit comments

Comments
 (0)