Skip to content

Commit

Permalink
#326 Add disabled state
Browse files Browse the repository at this point in the history
  • Loading branch information
wouter-adriaens committed Oct 7, 2024
1 parent 17eb19f commit 74a771b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/dumb/OeEditor.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div :id="props.id">
<div :id="`${props.id}-toolbar`">
<div :id="`${props.id}-toolbar`" :class="{ 'ql-toolbar--disabled': props.modDisabled }">
<div class="toolbar-group">
<button v-if="props.toolbar.undo" class="ql-undo" title="Undo">
<font-awesome-icon :icon="['fas', 'rotate-left']" />
Expand Down Expand Up @@ -191,6 +191,15 @@ watch(
margin-right: 0;
}
&--disabled {
cursor: not-allowed;
* {
cursor: not-allowed;
pointer-events: none;
}
}
.toolbar-group {
display: flex;
width: 100%;
Expand Down
15 changes: 15 additions & 0 deletions src/stories/dumb-components/editor.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,18 @@ export const FulloptionToolbar: Story = {
`,
}),
};

export const DisabledState: Story = {
render: () => ({
components: {
OeEditor,
},
setup() {
const model = ref('');
return { model };
},
template: `
<oe-editor mod-disabled id="editor-3" v-model="model" />
`,
}),
};

0 comments on commit 74a771b

Please sign in to comment.