mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
Merge pull request #7395 from artoscinote/ma_SCI_10546
Fix Open locally button behaviour with WOPI in preview [SCI-10546]
This commit is contained in:
commit
60fe1ec34b
|
@ -1,13 +1,12 @@
|
|||
<template>
|
||||
<div class="sn-open-locally-menu" @mouseenter="fetchLocalAppInfo">
|
||||
<button class="btn btn-light" v-if="!editWopiSupported" style="pointer-events: all;"
|
||||
:title="attachment.attributes.wopi_context.title" disabled="true">
|
||||
{{ attachment.attributes.wopi_context.button_text }}
|
||||
</button>
|
||||
<div v-else-if="!canOpenLocally && (attachment.attributes.wopi && attachment.attributes.urls.edit_asset)">
|
||||
<a :href="`${attachment.attributes.urls.edit_asset}`" target="_blank"
|
||||
class="block whitespace-nowrap rounded px-3 py-2.5
|
||||
hover:!text-sn-blue hover:no-underline cursor-pointer hover:bg-sn-super-light-grey">
|
||||
<div v-if="!canOpenLocally && (attachment.attributes.wopi && attachment.attributes.urls.edit_asset)">
|
||||
<a :href="editWopiSupported ? attachment.attributes.urls.edit_asset : null" target="_blank"
|
||||
class="block whitespace-nowrap rounded px-3 py-2.5 hover:!text-sn-blue hover:no-underline cursor-pointer hover:bg-sn-super-light-grey"
|
||||
:class="{ 'disabled': !editWopiSupported }"
|
||||
:title="editWopiSupported ? null : attachment.attributes.wopi_context.title"
|
||||
style="pointer-events: all"
|
||||
>
|
||||
{{ attachment.attributes.wopi_context.button_text }}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -75,7 +74,9 @@ export default {
|
|||
if (this.attachment.attributes.wopi && this.attachment.attributes.urls.edit_asset) {
|
||||
menu.push({
|
||||
text: this.attachment.attributes.wopi_context.button_text,
|
||||
url: this.attachment.attributes.urls.edit_asset,
|
||||
url: this.editWopiSupported ? this.attachment.attributes.urls.edit_asset : null,
|
||||
disabled: !this.editWopiSupported && 'style-only',
|
||||
title: this.editWopiSupported ? null : this.attachment.attributes.wopi_context.title,
|
||||
url_target: '_blank'
|
||||
});
|
||||
}
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
<div v-if="item.dividerBefore" class="border-0 border-t border-solid border-sn-light-grey"></div>
|
||||
<a :href="item.url" v-if="!item.submenu"
|
||||
:target="item.url_target || '_self'"
|
||||
:class="{ 'bg-sn-super-light-blue': item.active }"
|
||||
:class="{ 'bg-sn-super-light-blue': item.active, 'disabled': item.disabled }"
|
||||
:style="item.disabled === 'style-only' && 'pointer-events: all'"
|
||||
:title="item.title"
|
||||
:data-toggle="item.modalTarget && 'modal'"
|
||||
:data-target="item.modalTarget"
|
||||
:data-e2e="item.data_e2e"
|
||||
|
|
Loading…
Reference in a new issue