Make footer fixed in new form

This commit is contained in:
Ramon Wenger 2022-02-16 14:20:37 +01:00
parent 86591cd69b
commit d550b7057d
3 changed files with 64 additions and 19 deletions

View File

@ -95,9 +95,10 @@
@click="addBlock(outer)" @click="addBlock(outer)"
/> />
</div> </div>
</div><!-- -->
<!-- Save and Cancel buttons --> <!-- Save and Cancel buttons -->
<footer class="content-block-form__footer"> <footer class="content-block-form__footer">
<div class="content-block-form__buttons">
<button <button
:disabled="!isValid" :disabled="!isValid"
class="button button--primary" class="button button--primary"
@ -109,8 +110,8 @@
class="button" class="button"
@click="$emit('back')" @click="$emit('back')"
>Abbrechen</a> >Abbrechen</a>
</footer> </div>
</div><!-- --> </footer>
</div> </div>
</template> </template>
@ -307,15 +308,32 @@
}; };
</script> </script>
<style lang="scss">
@import '~styles/helpers';
// override parent page properties
.layout--no-scroll {
padding-bottom: 20px;
height: 100vh;
overflow-y: hidden;
box-sizing: border-box;
.module-page {
height: 100vh;
grid-template-rows: 60px 1fr;
padding-bottom: $small-spacing;
box-sizing: border-box;
}
}
</style>
<style scoped lang="scss"> <style scoped lang="scss">
@import '~styles/helpers'; @import '~styles/helpers';
.content-block-form { .content-block-form {
width: 800px;
max-width: 100%; max-width: 100%;
display: grid; display: grid;
grid-template-columns: 800px; grid-template-columns: 100vw;
grid-template-rows: 1fr auto; grid-template-rows: 85vh 80px;
grid-template-areas: grid-template-areas:
'content' 'content'
'footer'; 'footer';
@ -352,11 +370,28 @@
overflow-x: visible; overflow-x: visible;
overflow-y: auto; overflow-y: auto;
padding: 10px; padding: 10px;
align-items: center;
display: flex;
flex-direction: column;
& > * { // we make an exception and use a wildcard here
width: 800px;
max-width: 100vw;
box-sizing: border-box;
}
} }
&__footer { &__footer {
padding: $medium-spacing 0;
border-top: 1px solid $color-silver;
margin-top: auto; margin-top: auto;
grid-area: footer; grid-area: footer;
justify-content: center;
display: flex;
}
&__buttons {
width: 800px;
} }
} }
</style> </style>

View File

@ -45,7 +45,15 @@
}, },
specialContainerClass() { specialContainerClass() {
let cls = this.$store.state.specialContainerClass; let cls = this.$store.state.specialContainerClass;
return [cls ? `layout--${cls}` : '', {'skillbox--show-filter': this.showFilter}]; let metaClass = this.$route.meta.pageClass;
let classes = [{'skillbox--show-filter': this.showFilter}];
if(cls) {
classes.push(`layout--${cls}`);
}
if(metaClass) {
classes.push(`layout--${metaClass}`);
}
return classes;
}, },
enableFooter() { enableFooter() {
return enableFooter() && (!this.$route.meta || !this.$route.meta.hideFooter); return enableFooter() && (!this.$route.meta || !this.$route.meta.hideFooter);

View File

@ -1,12 +1,13 @@
import { import {
CREATE_CONTENT_BLOCK_AFTER_PAGE,
CREATE_CONTENT_BLOCK_UNDER_PARENT_PAGE,
EDIT_CONTENT_BLOCK_PAGE,
MODULE_PAGE, MODULE_PAGE,
MODULE_SETTINGS_PAGE, MODULE_SETTINGS_PAGE,
SNAPSHOT_DETAIL, SNAPSHOT_DETAIL,
SNAPSHOT_LIST, SNAPSHOT_LIST,
SUBMISSIONS_PAGE, SUBMISSIONS_PAGE,
VISIBILITY_PAGE, VISIBILITY_PAGE,
CREATE_CONTENT_BLOCK_AFTER_PAGE,
CREATE_CONTENT_BLOCK_UNDER_PARENT_PAGE, EDIT_CONTENT_BLOCK_PAGE,
} from '@/router/module.names'; } from '@/router/module.names';
import {LAYOUT_SIMPLE} from '@/router/core.constants'; import {LAYOUT_SIMPLE} from '@/router/core.constants';
import createContentBlock from '@/pages/createContentBlock'; import createContentBlock from '@/pages/createContentBlock';
@ -21,15 +22,16 @@ const snapshots = () => import(/* webpackChunkName: "modules" */'@/pages/snapsho
const snapshot = () => import(/* webpackChunkName: "modules" */'@/pages/snapshot/snapshot'); const snapshot = () => import(/* webpackChunkName: "modules" */'@/pages/snapshot/snapshot');
const contentBlockFormMeta = { const contentBlockFormMeta = {
// layout: LAYOUT_SIMPLE, // layout: LAYOUT_SIMPLE,
hideFooter: true, hideFooter: true,
hideHeader: true, hideHeader: true,
showSubNavigation: true showSubNavigation: true,
}; pageClass: 'no-scroll',
};
const createContentBlockRouteFragment = { const createContentBlockRouteFragment = {
component: createContentBlock, component: createContentBlock,
meta: contentBlockFormMeta, meta: contentBlockFormMeta,
props: true props: true,
}; };
export default [ export default [
@ -93,7 +95,7 @@ export default [
meta: contentBlockFormMeta, meta: contentBlockFormMeta,
props: true, props: true,
component: editContentBlock, component: editContentBlock,
name: EDIT_CONTENT_BLOCK_PAGE name: EDIT_CONTENT_BLOCK_PAGE,
}, },
{ {
...createContentBlockRouteFragment, ...createContentBlockRouteFragment,
@ -104,7 +106,7 @@ export default [
...createContentBlockRouteFragment, ...createContentBlockRouteFragment,
path: 'add-under-parent/:parent', path: 'add-under-parent/:parent',
name: CREATE_CONTENT_BLOCK_UNDER_PARENT_PAGE, name: CREATE_CONTENT_BLOCK_UNDER_PARENT_PAGE,
} },
], ],
}, },
]; ];