зеркало из https://github.com/nextcloud/deck.git
Make rename functions accessibly by keyboard navigation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Родитель
90a2b07e5f
Коммит
b3f252ee46
|
@ -222,6 +222,7 @@ export default {
|
|||
padding: $stack-spacing;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
scrollbar-gutter: stable;
|
||||
padding-top: 15px;
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
|
|
@ -23,15 +23,22 @@
|
|||
|
||||
<template>
|
||||
<div class="stack">
|
||||
<div v-click-outside="stopCardCreation" class="stack__header" :class="{'stack__header--add': showAddCard }">
|
||||
<div v-click-outside="stopCardCreation"
|
||||
class="stack__header"
|
||||
:class="{'stack__header--add': showAddCard }"
|
||||
tabindex="0"
|
||||
:aria-label="stack.title">
|
||||
<transition name="fade" mode="out-in">
|
||||
<h3 v-if="!canManage || isArchived">
|
||||
{{ stack.title }}
|
||||
</h3>
|
||||
<h3 v-else-if="!editing"
|
||||
v-tooltip="stack.title"
|
||||
tabindex="0"
|
||||
:aria-label="stack.title"
|
||||
class="stack__title"
|
||||
@click="startEditing(stack)">
|
||||
@click="startEditing(stack)"
|
||||
@keydown.enter="startEditing(stack)">
|
||||
{{ stack.title }}
|
||||
</h3>
|
||||
<form v-else @submit.prevent="finishedEdit(stack)">
|
||||
|
@ -325,36 +332,47 @@ export default {
|
|||
flex-grow: 1;
|
||||
display: flex;
|
||||
cursor: inherit;
|
||||
margin: 0;
|
||||
|
||||
input[type=text] {
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.stack__title {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: calc($stack-width - 60px);
|
||||
h3.stack__title {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: calc($stack-width - 60px);
|
||||
border-radius: 3px;
|
||||
margin: 6px;
|
||||
padding: 4px 4px;
|
||||
|
||||
&:focus {
|
||||
outline: 2px solid var(--color-border-dark);
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 2px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.stack__card-add {
|
||||
width: $stack-width;
|
||||
height: 44px;
|
||||
flex-shrink: 0;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
margin-left: 12px;
|
||||
margin-right: 12px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 20px;
|
||||
background-color: var(--color-main-background);
|
||||
|
||||
form {
|
||||
display: flex;
|
||||
margin-left: 12px;
|
||||
margin-right: 12px;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
box-shadow: 0 0 3px var(--color-box-shadow);
|
||||
border-radius: var(--border-radius-large);
|
||||
overflow: hidden;
|
||||
|
|
|
@ -35,14 +35,18 @@
|
|||
{{ board.title }} » {{ stack.title }}
|
||||
</div>
|
||||
<div class="card-upper">
|
||||
<h3 v-if="compactMode || isArchived || showArchived || !canEdit || standalone">
|
||||
<h3 v-if="inlineEditingBlocked">
|
||||
{{ card.title }}
|
||||
</h3>
|
||||
<h3 v-else-if="!editing">
|
||||
<span @click.stop="startEditing(card)">{{ card.title }}</span>
|
||||
<h3 v-else-if="!editing"
|
||||
tabindex="0"
|
||||
class="editable"
|
||||
:aria-label="t('deck', 'Edit card title')"
|
||||
@click.stop="startEditing(card)"
|
||||
@keydown.enter.stop.prevent="startEditing(card)">
|
||||
{{ card.title }}
|
||||
</h3>
|
||||
|
||||
<form v-if="editing"
|
||||
<form v-else-if="editing"
|
||||
v-click-outside="cancelEdit"
|
||||
class="dragDisabled"
|
||||
@click.stop
|
||||
|
@ -135,6 +139,9 @@ export default {
|
|||
const board = this.$store.getters.boards.find((item) => item.id === this.card.boardId)
|
||||
return board ? !board.archived && board.permissions.PERMISSION_EDIT : false
|
||||
},
|
||||
inlineEditingBlocked() {
|
||||
return this.compactMode || this.isArchived || this.showArchived || !this.canEdit || this.standalone
|
||||
},
|
||||
card() {
|
||||
return this.item ? this.item : this.$store.getters.cardById(this.id)
|
||||
},
|
||||
|
@ -217,14 +224,20 @@ export default {
|
|||
|
||||
}
|
||||
h3 {
|
||||
margin: 12px $card-padding;
|
||||
margin: 5px $card-padding;
|
||||
padding: 6px;
|
||||
flex-grow: 1;
|
||||
font-size: 100%;
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
padding-left: 4px;
|
||||
span {
|
||||
&.editable {
|
||||
cursor: text;
|
||||
|
||||
&:focus {
|
||||
outline: 2px solid var(--color-border-dark);
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
input[type=text] {
|
||||
|
|
Загрузка…
Ссылка в новой задаче