Small fixes on Term Edition form behavior
This commit is contained in:
parent
f6208ba3a9
commit
48fc6684a4
|
@ -25,14 +25,14 @@
|
|||
:class="{'is-disabled': isEditingTerm}">
|
||||
<a
|
||||
@click.prevent="editTerm()">
|
||||
<b-icon
|
||||
size="is-small"
|
||||
icon="pencil"/>
|
||||
<span class="icon">
|
||||
<i class="mdi mdi-18px mdi-pencil"/>
|
||||
</span>
|
||||
</a>
|
||||
<a @click.prevent="tryToRemoveTerm()">
|
||||
<b-icon
|
||||
size="is-small"
|
||||
icon="delete"/>
|
||||
<span class="icon">
|
||||
<i class="mdi mdi-18px mdi-delete"/>
|
||||
</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -62,19 +62,10 @@ export default {
|
|||
'updateTerm',
|
||||
'deleteTerm'
|
||||
]),
|
||||
editTerm() {
|
||||
|
||||
// Position edit form in a visible area
|
||||
let container = document.getElementById('repository-container');
|
||||
if (container && container.scrollTop && container.scrollTop > 80)
|
||||
this.termEditionFormTop = container.scrollTop - 80;
|
||||
else
|
||||
this.termEditionFormTop = 0;
|
||||
|
||||
editTerm() {
|
||||
this.term.opened = !this.term.opened;
|
||||
|
||||
this.$termsListBus.onEditTerm(this.term);
|
||||
|
||||
},
|
||||
tryToRemoveTerm() {
|
||||
|
||||
|
@ -186,7 +177,7 @@ export default {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
background-color: $gray2;
|
||||
padding: 0.76rem 0.875rem;
|
||||
padding: 0.5rem 0.875rem;
|
||||
|
||||
a {
|
||||
display: flex;
|
||||
|
|
|
@ -164,14 +164,7 @@ export default {
|
|||
|
||||
},
|
||||
editTerm() {
|
||||
|
||||
// Position edit form in a visible area
|
||||
let container = document.getElementById('repository-container');
|
||||
if (container && container.scrollTop && container.scrollTop > 80)
|
||||
this.termEditionFormTop = container.scrollTop - 80;
|
||||
else
|
||||
this.termEditionFormTop = 0;
|
||||
|
||||
|
||||
this.term.opened = !this.term.opened;
|
||||
|
||||
this.$termsListBus.onEditTerm(this.term);
|
||||
|
@ -256,7 +249,7 @@ export default {
|
|||
// Term Item
|
||||
.term-item {
|
||||
font-size: 14px;
|
||||
padding: 0 0 0 2.75rem;
|
||||
padding: 0 0 0 1.75rem;
|
||||
min-height: 40px;
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
|
|
@ -357,6 +357,14 @@ export default {
|
|||
this.loadTerms(0);
|
||||
}
|
||||
this.$termsListBus.$on('editTerm', (term) => {
|
||||
|
||||
// Position edit form in a visible area
|
||||
let container = document.getElementById('repository-container');
|
||||
if (container && container.scrollTop && container.scrollTop > 80)
|
||||
this.termEditionFormTop = container.scrollTop - 80;
|
||||
else
|
||||
this.termEditionFormTop = 0;
|
||||
|
||||
this.editTerm = term;
|
||||
this.isEditingTerm = true;
|
||||
});
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
{{ $i18n.get('cancel') }}
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="button is-success"
|
||||
@click="onConfirm(); $parent.close();">
|
||||
{{ $i18n.get('continue') }}
|
||||
|
|
Loading…
Reference in New Issue