Add disabled state for task titles
This commit is contained in:
parent
79c8783fdb
commit
d0e304e43b
3 changed files with 16 additions and 3 deletions
|
@ -8,10 +8,11 @@
|
||||||
</h1>
|
</h1>
|
||||||
<div class="is-done" v-if="task.done">Done</div>
|
<div class="is-done" v-if="task.done">Done</div>
|
||||||
<h1
|
<h1
|
||||||
|
class="title input"
|
||||||
|
:class="{'disabled': !canWrite}"
|
||||||
@focusout="save()"
|
@focusout="save()"
|
||||||
@keyup.ctrl.enter="save()"
|
@keyup.ctrl.enter="save()"
|
||||||
class="title input"
|
:contenteditable="canWrite ? 'true' : 'false'"
|
||||||
contenteditable="true"
|
|
||||||
ref="taskTitle">
|
ref="taskTitle">
|
||||||
{{ task.title }}
|
{{ task.title }}
|
||||||
</h1>
|
</h1>
|
||||||
|
@ -49,6 +50,10 @@ export default {
|
||||||
value: {
|
value: {
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
canWrite: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newVal) {
|
value(newVal) {
|
||||||
|
|
|
@ -179,6 +179,14 @@
|
||||||
background: $input-background-color;
|
background: $input-background-color;
|
||||||
border-color: $input-focus-border-color;
|
border-color: $input-focus-border-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
&:focus, &:hover {
|
||||||
|
background: transparent !important;
|
||||||
|
border-color: transparent !important;
|
||||||
|
cursor: default !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3 {
|
h1, h2, h3 {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div :class="{ 'is-loading': taskService.loading}" class="loader-container task-view-container">
|
<div :class="{ 'is-loading': taskService.loading}" class="loader-container task-view-container">
|
||||||
<div class="task-view">
|
<div class="task-view">
|
||||||
<heading v-model="task"/>
|
<heading v-model="task" :can-write="canWrite"/>
|
||||||
<h6 class="subtitle" v-if="parent && parent.namespace && parent.list">
|
<h6 class="subtitle" v-if="parent && parent.namespace && parent.list">
|
||||||
{{ parent.namespace.title }} >
|
{{ parent.namespace.title }} >
|
||||||
<router-link :to="{ name: listViewName, params: { listId: parent.list.id } }">
|
<router-link :to="{ name: listViewName, params: { listId: parent.list.id } }">
|
||||||
|
|
Loading…
Reference in a new issue