Skip to content

Commit

Permalink
added muted overlay for disabled editor
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoeejoee committed May 21, 2020
1 parent e044b01 commit 910d0e7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/components/TiptapVuetify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<div
v-if="editor"
class="tiptap-vuetify-editor"
:class="{
'tiptap-vuetify-editor--disabled': $props[PROPS.DISABLED]
}"
>
<bubble
v-if="availableActions.bubbleMenu.length && editor.options.editable"
Expand Down Expand Up @@ -40,6 +43,9 @@
:editor="editor"
:style="contentDynamicStyles"
class="tiptap-vuetify-editor__content"
:class="{
'tiptap-vuetify-editor__content--disabled': $props[PROPS.DISABLED]
}"
/>

<slot name="footer" />
Expand Down Expand Up @@ -283,6 +289,9 @@ export default class TiptapVuetify extends Vue {
outline: none !important
margin: 20px !important
&--disabled
cursor: not-allowed
/* Элемент не обязательно содрежится в .tiptap-vuetify-editor, может использоваться для отображения результата
редактора в не редактора */
.tiptap-vuetify-editor__content
Expand Down Expand Up @@ -329,4 +338,18 @@ export default class TiptapVuetify extends Vue {
pointer-events: none
height: 0
font-style: italic
&--disabled
// same color for disabled text as default light vuetify theme: vuetify/src/styles/settings/_light.scss#L30
color rgba(0, 0, 0, 0.38)
&:after
// same as background as for filled v-text-input: vuetify/src/styles/settings/_light.scss#L87
background-color: rgba(0, 0, 0, 0.06)
position: absolute
content: ''
top: 0
left: 0
right: 0
bottom: 0
</style>

0 comments on commit 910d0e7

Please sign in to comment.