Skip to content
Snippets Groups Projects
Commit b54b4970 authored by Ron Lucke's avatar Ron Lucke
Browse files

fix #4033

Closes #4033

Merge request studip/studip!2900
parent ef54bef7
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
} }
.cw-element-inserter-wrapper { .cw-element-inserter-wrapper {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
grid-auto-rows: auto; grid-auto-rows: auto;
grid-gap: 4px; grid-gap: 4px;
margin-bottom: 8px; margin-bottom: 8px;
......
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
min-height: 100%; min-height: 100%;
border: solid thin var(--content-color-40); border: solid thin var(--content-color-40);
background-color: var(--white); background-color: var(--white);
overflow-y: auto; overflow: hidden;
overflow-x: hidden;
position: relative; position: relative;
padding: 0 4px; padding: 0 4px;
top: 0; top: 0;
...@@ -33,6 +32,11 @@ ...@@ -33,6 +32,11 @@
right: 0; right: 0;
} }
.cw-toolbar-tool-content {
overflow-y: auto;
padding-right: 8px;
}
.cw-toolbar-blocks { .cw-toolbar-blocks {
.input-group.files-search { .input-group.files-search {
&.search { &.search {
...@@ -96,6 +100,12 @@ ...@@ -96,6 +100,12 @@
} }
} }
.cw-toolbar-clipboard {
.cw-collapsible {
margin-bottom: 4px;
}
}
} }
.cw-toolbar-folded-wrapper { .cw-toolbar-folded-wrapper {
display: flex; display: flex;
...@@ -124,6 +134,7 @@ ...@@ -124,6 +134,7 @@
&.cw-toolbar-button-toggle { &.cw-toolbar-button-toggle {
text-align: end; text-align: end;
flex-grow: 1;
} }
&.active { &.active {
...@@ -142,7 +153,7 @@ ...@@ -142,7 +153,7 @@
.cw-toolbar-tools.hd { .cw-toolbar-tools.hd {
.cw-toolbar-button-wrapper { .cw-toolbar-button-wrapper {
.cw-toolbar-button { .cw-toolbar-button {
width: 128px; min-width: 110px;
padding: 2px 16px 0 16px; padding: 2px 16px 0 16px;
&.cw-toolbar-button-toggle { &.cw-toolbar-button-toggle {
text-align: end; text-align: end;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="cw-toolbar-wrapper"> <div class="cw-toolbar-wrapper">
<div id="cw-toolbar" class="cw-toolbar" :style="toolbarStyle"> <div id="cw-toolbar" class="cw-toolbar" :style="toolbarStyle">
<div v-if="showTools" class="cw-toolbar-tools" :class="{ unfold: unfold, hd: isHd, wqhd: isWqhd }"> <div v-if="showTools" class="cw-toolbar-tools" :class="{ unfold: unfold, hd: isHd, wqhd: isWqhd }">
<div class="cw-toolbar-button-wrapper"> <div id="cw-toolbar-nav" class="cw-toolbar-button-wrapper">
<button <button
class="cw-toolbar-button" class="cw-toolbar-button"
:class="{ active: activeTool === 'blockAdder' }" :class="{ active: activeTool === 'blockAdder' }"
...@@ -35,9 +35,19 @@ ...@@ -35,9 +35,19 @@
<studip-icon shape="arr_2right" :size="24" /> <studip-icon shape="arr_2right" :size="24" />
</button> </button>
</div> </div>
<courseware-toolbar-blocks v-if="activeTool === 'blockAdder'" /> <div class="cw-toolbar-tool-wrapper">
<courseware-toolbar-containers v-if="activeTool === 'containerAdder'" /> <CoursewareToolbarBlocks
<courseware-toolbar-clipboard v-if="activeTool === 'clipboard'" /> v-if="activeTool === 'blockAdder'"
:toolbarContentHeight="toolbarContentHeight"
/>
<CoursewareToolbarContainers
v-if="activeTool === 'containerAdder'"
/>
<CoursewareToolbarClipboard
v-if="activeTool === 'clipboard'"
:toolbarContentHeight="toolbarContentHeight"
/>
</div>
</div> </div>
<div v-else class="cw-toolbar-folded-wrapper"> <div v-else class="cw-toolbar-folded-wrapper">
<button <button
...@@ -97,20 +107,26 @@ export default { ...@@ -97,20 +107,26 @@ export default {
toolbarActive: 'toolbarActive', toolbarActive: 'toolbarActive',
hideEditLayout: 'hideEditLayout', hideEditLayout: 'hideEditLayout',
}), }),
toolbarStyle() { scrollTopStyles() {
const scrollTopStyles = window.getComputedStyle(document.getElementById('scroll-to-top')); return window.getComputedStyle(document.getElementById('scroll-to-top'));
},
toolbarHeight() {
const scrollTopHeight = const scrollTopHeight =
parseInt(scrollTopStyles['height'], 10) + parseInt(this.scrollTopStyles['height'], 10) +
parseInt(scrollTopStyles['padding-top'], 10) + parseInt(this.scrollTopStyles['padding-top'], 10) +
parseInt(scrollTopStyles['padding-bottom'], 10) + parseInt(this.scrollTopStyles['padding-bottom'], 10) +
parseInt(scrollTopStyles['margin-bottom'], 10); parseInt(this.scrollTopStyles['margin-bottom'], 10);
let height = parseInt( return parseInt(
Math.min(this.windowInnerHeight * 0.9, this.windowInnerHeight - this.toolbarTop - scrollTopHeight) Math.min(this.windowInnerHeight * 0.9, this.windowInnerHeight - this.toolbarTop - scrollTopHeight)
); );
},
toolbarContentHeight() {
return this.toolbarHeight - 55;
},
toolbarStyle() {
return { return {
height: height + 'px', height: this.toolbarHeight + 'px',
minHeight: height + 'px', minHeight: this.toolbarHeight + 'px',
top: this.toolbarTop + 'px', top: this.toolbarTop + 'px',
}; };
}, },
......
<template> <template>
<div class="cw-toolbar-blocks"> <div class="cw-toolbar-blocks">
<div id="cw-toolbar-blocks-header" class="cw-toolbar-tool-header">
<form @submit.prevent="loadSearch"> <form @submit.prevent="loadSearch">
<div class="input-group files-search search cw-block-search"> <div class="input-group files-search search cw-block-search">
<input <input
...@@ -46,7 +47,8 @@ ...@@ -46,7 +47,8 @@
{{ category.title }} {{ category.title }}
</button> </button>
</div> </div>
</div>
<div class="cw-toolbar-tool-content" :style="toolContentStyle">
<div v-if="filteredBlockTypes.length > 0" class="cw-blockadder-item-list"> <div v-if="filteredBlockTypes.length > 0" class="cw-blockadder-item-list">
<draggable <draggable
v-if="filteredBlockTypes.length > 0" v-if="filteredBlockTypes.length > 0"
...@@ -81,6 +83,7 @@ ...@@ -81,6 +83,7 @@
mood="pointing" mood="pointing"
/> />
</div> </div>
</div>
</template> </template>
<script> <script>
...@@ -99,6 +102,12 @@ export default { ...@@ -99,6 +102,12 @@ export default {
CoursewareCompanionBox, CoursewareCompanionBox,
draggable, draggable,
}, },
props: {
toolbarContentHeight: {
type: Number,
required: true,
},
},
data() { data() {
return { return {
searchInput: '', searchInput: '',
...@@ -132,6 +141,13 @@ export default { ...@@ -132,6 +141,13 @@ export default {
{ title: this.$gettext('Biografie'), type: 'biography' }, { title: this.$gettext('Biografie'), type: 'biography' },
]; ];
}, },
toolContentStyle() {
const height = this.toolbarContentHeight - 115;
return {
height: height + 'px',
};
},
}, },
methods: { methods: {
...mapActions({ ...mapActions({
......
<template> <template>
<div class="cw-toolbar-clipboard"> <div class="cw-toolbar-clipboard cw-toolbar-tool-content" :style="toolContentStyle">
<courseware-collapsible-box :title="$gettext('Blöcke')" :open="clipboardBlocks.length > 0"> <courseware-collapsible-box :title="$gettext('Blöcke')" :open="clipboardBlocks.length > 0">
<template v-if="clipboardBlocks.length > 0"> <template v-if="clipboardBlocks.length > 0">
<div class="cw-element-inserter-wrapper"> <div class="cw-element-inserter-wrapper">
...@@ -101,7 +101,12 @@ export default { ...@@ -101,7 +101,12 @@ export default {
StudipDialog, StudipDialog,
draggable, draggable,
}, },
props: {
toolbarContentHeight: {
type: Number,
required: true,
},
},
data() { data() {
return { return {
showDeleteClipboardDialog: false, showDeleteClipboardDialog: false,
...@@ -143,6 +148,11 @@ export default { ...@@ -143,6 +148,11 @@ export default {
} }
return ''; return '';
}, },
toolContentStyle() {
return {
height: this.toolbarContentHeight + 'px',
};
},
}, },
methods: { methods: {
...mapActions({ ...mapActions({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment