Skip to content

Commit

Permalink
Merge pull request #2031 from rebeccacremona/touch-targets
Browse files Browse the repository at this point in the history
Re-order casebook contents via a handle
  • Loading branch information
rebeccacremona authored Oct 13, 2023
2 parents 3ed6a3c + 3dec823 commit 4bb7ffa
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
4 changes: 2 additions & 2 deletions web/frontend/components/CollapseTriangle.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<svg height="32" width="32" v-bind:class="{open: !collapsed, collapsed:collapsed}">
<polygon points="6,6 20,16 6,24" />
<svg height="20" width="32" v-bind:class="{open: !collapsed, collapsed:collapsed}">
<polygon points="6,0 20,10 6,18" />
</svg>
</template>

Expand Down
24 changes: 22 additions & 2 deletions web/frontend/components/TableOfContents/Entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
v-bind:class="['listing-wrapper', showDelete ? 'delete-confirm' : '', animated, dimmed]"
v-click-outside.stop.prevent="dismissAudit"
>
<component :is="editing ? 'vue-nestable-handle' : 'div'" v-bind:item="item">
<div v-bind:item="item">
<div v-bind:class="{'listing':true, 'resource':true, 'temporary': item.resource_type == 'Temp', 'editing': 'editing'}" v-if="isResource">
<vue-nestable-handle v-if="editing" class="drag-target" :item="item"><i class="fa fa-th" aria-hidden="true"></i></vue-nestable-handle>
<div class="list-left">
<div :class="{'section-number': true, 'is-instructional-material': item.is_instructional_material}">{{ item.ordinal_string }}</div>

Expand Down Expand Up @@ -64,6 +65,7 @@
</div>

<div class="listing section" v-bind:class="['listing', 'section' ,item.children.length > 0 ? 'child-present' : 'child-free', editing ? 'editing' : '' ]" v-else>
<vue-nestable-handle v-if="editing" class="drag-target" :item="item"><i class="fa fa-th" aria-hidden="true"></i></vue-nestable-handle>
<div class="list-left">
<button
aria-role="heading"
Expand Down Expand Up @@ -110,7 +112,7 @@

</div>
</div>
</component>
</div>
<div class="audit-drawer" v-if="item.audit && item.resource_type === 'Temp'">
<entry-auditor :item="item"></entry-auditor>
</div>
Expand Down Expand Up @@ -298,4 +300,22 @@ export default {
border: none;
background: none;
}
.drag-target {
position: absolute;
height: 100%;
width: 2em;
right: -2.25em;
display: flex;
justify-content: center;
align-content: center;
flex-direction: column;
text-align: center;
color: #777;
background: lightgray;
&:hover {
cursor: grab;
}
}
</style>
15 changes: 4 additions & 11 deletions web/frontend/components/TheTableOfContents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ export default {
button.action-expand {
border: 0 solid transparent;
background: transparent;
margin: -8px;
}
button.toc-expand {
display: flex;
Expand Down Expand Up @@ -347,7 +346,7 @@ export default {
.listing {
display: flex;
justify-content:space-between;
align-items: baseline;
align-items: center;
width: 100%;
padding: 12px 16px;
/* padding-right: 42px; */
Expand All @@ -359,7 +358,7 @@ export default {
display: flex;
flex-direction:row;
div {
align-self:baseline;
align-self:center;
}
.is-instructional-material {
background-image:url('~static/images/ui/casebook/lock.svg') ;
Expand All @@ -375,13 +374,9 @@ export default {
}
.actions {
position: relative;
top: 12px;
top: 0;
}
&.section {
.actions {
min-height:44px;
}
align-items: left;
background-color: $black;
Expand Down Expand Up @@ -541,7 +536,7 @@ export default {
@media (min-width: $screen-xs) {
&.section {
flex-direction: row;
align-items: baseline;
align-items: center;
}
}
.section-number,
Expand Down Expand Up @@ -587,13 +582,11 @@ export default {
.nestable-list {
border-left: 8px solid $light-blue;
padding-left: 16px;
margin-left: 30px;
}
}
div.editable .nestable-list .nestable-list {
border-left: 8px solid $yellow;
padding-left: 16px;
margin-left: 30px;
}
.nestable-drag-layer {
opacity: 0.7;
Expand Down
9 changes: 5 additions & 4 deletions web/frontend/styles/casebook.scss
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ form.edit_content_resource, form.edit_content_section, form.edit_content_caseboo

.actions {
margin-left: 1rem;
margin-top: -8px;
> form > input[type=submit], button {
// @include square(50px);
display: block;
Expand All @@ -540,8 +539,9 @@ form.edit_content_resource, form.edit_content_section, form.edit_content_caseboo
background-size: auto;
&.action-delete {
background-image: url('~static/images/ui/edit/elide.png');
height: 36px;
width: 36px;
height: 20px;
width: 20px;
margin: 0;
border-width: 0px;
background-color: transparent;
}
Expand Down Expand Up @@ -593,6 +593,7 @@ form.edit_content_resource, form.edit_content_section, form.edit_content_caseboo
grid-template-columns: auto 1fr 15%;

@media (max-width: $screen-xs) {
padding-right: 0;
.resource-container {
margin: 0 9px;
}
Expand Down Expand Up @@ -903,4 +904,4 @@ div.tox-toolbar__group:nth-child(2) button.tox-tbtn.tox-tbtn--select.tox-tbtn--d

.casebook-copyright-notice {
margin-top: 4rem;
}
}
Binary file modified web/static/images/ui/edit/elide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4bb7ffa

Please sign in to comment.