Adjustments on Terms Edition List.

This commit is contained in:
Mateus Machado Luna 2018-07-31 15:10:31 -03:00
parent 659ab5ade1
commit c15c2e05fe
3 changed files with 58 additions and 24 deletions

View File

@ -14,7 +14,9 @@
<tainacan-repository-subheader <tainacan-repository-subheader
:is-repository-level="isRepositoryLevel" :is-repository-level="isRepositoryLevel"
:is-menu-compressed="isMenuCompressed"/> :is-menu-compressed="isMenuCompressed"/>
<div class="column is-main-content"> <div
id="repository-container"
class="column is-main-content">
<router-view /> <router-view />
</div> </div>
</div> </div>

View File

@ -243,10 +243,24 @@
} }
} }
@keyframes enter {
from {
opacity: 0;
transform: translate(-40px,0);
}
to {
opacity: 1;
transform: translate(0px,0);
}
}
form { form {
padding: 2.0rem 0rem 1rem 3rem; padding: 2.0rem 0rem 1rem 3rem;
border-left: 1px solid $gray2; border-left: 1px solid $gray2;
margin-top: 1.0em; margin-top: 1.0em;
position: relative;
animation-name: enter;
animation-duration: 0.5s;
.tainacan-page-title { .tainacan-page-title {
margin-bottom: 40px; margin-bottom: 40px;

View File

@ -24,7 +24,7 @@
class="term-item" class="term-item"
:class="{ :class="{
'not-sortable-item': term.opened || !term.saved, 'not-sortable-item': term.opened || !term.saved,
'not-focusable-item': term.opened 'opened-term': term.opened
}" }"
:style="{'margin-left': (term.depth * 40) + 'px'}" :style="{'margin-left': (term.depth * 40) + 'px'}"
v-for="(term, index) in orderedTermsList" v-for="(term, index) in orderedTermsList"
@ -81,11 +81,12 @@
</div> </div>
</div> </div>
<div <div
class="column" class="column edit-forms-list"
:key="index" :key="index"
v-for="(term, index) in orderedTermsList" v-for="(term, index) in orderedTermsList"
v-show="term.opened"> v-show="term.opened">
<term-edition-form <term-edition-form
:style="{ 'top': termEditionFormTop + 'px'}"
:taxonomy-id="taxonomyId" :taxonomy-id="taxonomyId"
@onEditionFinished="onTermEditionFinished()" @onEditionFinished="onTermEditionFinished()"
@onEditionCanceled="onTermEditionCanceled(term)" @onEditionCanceled="onTermEditionCanceled(term)"
@ -113,7 +114,8 @@ export default {
isEditingTerm: false, isEditingTerm: false,
formWithErrors: '', formWithErrors: '',
orderedTermsList: [], orderedTermsList: [],
order: 'asc' order: 'asc',
termEditionFormTop: 0
} }
}, },
props: { props: {
@ -188,7 +190,15 @@ export default {
this.editTerm(newTerm, parentIndex + 1); this.editTerm(newTerm, parentIndex + 1);
}, },
editTerm(term, index) { editTerm(term, index) {
let container = document.getElementById('repository-container');
if (container && container.scrollTop && container.scrollTop > 80)
this.termEditionFormTop = container.scrollTop - 80;
else
this.termEditionFormTop = 0;
this.isEditingTerm = true; this.isEditingTerm = true;
if (!term.opened) { if (!term.opened) {
for (let i = 0; i < this.orderedTermsList.length; i++) { for (let i = 0; i < this.orderedTermsList.length; i++) {
@ -398,6 +408,10 @@ export default {
display: block; display: block;
position: relative; position: relative;
&:hover {
background-color: $gray1 !important;
}
.handle { .handle {
padding-right: 6em; padding-right: 6em;
} }
@ -443,33 +457,37 @@ export default {
} }
} }
&.not-sortable-item, &.not-sortable-item:hover { &.opened-term {
cursor: default;
background-color: white !important;
}
&.not-focusable-item, &.not-focusable-item:hover {
cursor: default; cursor: default;
background-color: $blue1;
.term-name { .term-name {
color: $turquoise3; color: $blue3;
}
&:before {
content: '';
display: block;
position: absolute;
left: 100%;
right: -20px;
width: 0;
height: 0;
border-style: solid;
border-color: transparent transparent transparent $blue1;
border-left-width: 16px;
border-top-width: 20px;
border-bottom-width: 20px;
top: 0;
}
&:hover:before {
border-color: transparent transparent transparent $gray1;
} }
} }
} }
// .term-item:hover:not(.not-sortable-item) { .edit-forms-list {
// background-color: $secondary; padding-left: 0;
// border-color: $secondary; }
// color: white !important;
// .label-details, .icon, .not-saved {
// color: white !important;
// }
// .grip-icon {
// fill: white;
// }
// }
</style> </style>