Skip to content

Commit 3441307

Browse files
committed
Show link url in popover
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent cd494fd commit 3441307

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/EditorFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const createEditor = ({ content, onInit, onUpdate, extensions, enableRichEditing
7676
new CodeBlock(),
7777
new ListItem(),
7878
new Link({
79-
openOnClick: true,
79+
openOnClick: false,
8080
}),
8181
new Image(),
8282
new Placeholder({

src/components/MenuBubble.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
<template>
2424
<EditorMenuBubble v-slot="{ commands, isActive, getMarkAttrs, menu }"
25+
:is-active-callback="({ isActive }) => isActive.link()"
2526
class="menububble"
2627
:editor="editor"
2728
@hide="hideLinkMenu">
@@ -37,12 +38,13 @@
3738
</form>
3839

3940
<template v-else>
41+
<a :href="getMarkAttrs('link').href" target="_blank" class="icon-external">{{ getMarkAttrs('link').href }}</a>
4042
<button
4143
class="menububble__button"
4244
:class="{ 'is-active': isActive.link() }"
4345
@click="showLinkMenu(getMarkAttrs('link'))">
44-
<span v-tooltip="isActive.link() ? 'Update Link' : 'Add Link'" class="icon-link" />
45-
<span class="menububble__buttontext">{{ t('text', 'Add link') }}</span>
46+
<span v-tooltip="isActive.link() ? t('text', 'Update Link') : t('text', 'Add Link')" class="icon-link" />
47+
<span class="menububble__buttontext">{{ isActive.link() ? t('text', 'Update Link') : t('text', 'Add Link') }}</span>
4648
</button>
4749
</template>
4850
</div>
@@ -148,5 +150,16 @@ export default {
148150
background: transparent;
149151
min-width: 150px;
150152
}
153+
154+
.icon-external {
155+
max-width: 50vw;
156+
text-overflow: ellipsis;
157+
overflow: hidden;
158+
display: block;
159+
white-space: nowrap;
160+
padding: 5px 20px 5px 5px;
161+
background-position: right;
162+
margin-right: 5px;
163+
}
151164
}
152165
</style>

0 commit comments

Comments
 (0)