mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-08 15:31:02 +08:00
Merge pull request #6363 from artoscinote/ma_SCI_9410
Fix attachment issues [SCI-9410]
This commit is contained in:
commit
19c44c50ff
12 changed files with 29 additions and 5 deletions
|
|
@ -201,6 +201,8 @@ var MarvinJsEditorApi = (function() {
|
|||
}
|
||||
$(marvinJsModal).modal('hide');
|
||||
config.button.dataset.inProgress = false;
|
||||
|
||||
if (MarvinJsEditor.saveCallback) MarvinJsEditor.saveCallback();
|
||||
},
|
||||
error: function(response) {
|
||||
if (response.status === 403) {
|
||||
|
|
@ -295,6 +297,7 @@ $(document).on('click', '.marvinjs-edit-button', function() {
|
|||
var editButton = $(this);
|
||||
$.post(editButton.data('sketch-start-edit-url'));
|
||||
$('#filePreviewModal').modal('hide');
|
||||
|
||||
MarvinJsEditor.open({
|
||||
mode: 'edit',
|
||||
data: editButton.data('sketch-description'),
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@
|
|||
text-align: center;
|
||||
width: calc(100% - 4rem);
|
||||
|
||||
&.file-preview-container__wopi {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.asset-image {
|
||||
background-color: var(--sn-white);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
@attachment:viewMode="updateAttachmentViewMode"
|
||||
@attachment:delete="deleteAttachment(attachment.id)"
|
||||
@attachment:moved="attachmentMoved"
|
||||
@attachment:uploaded="$emit('attachment:uploaded')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -154,7 +154,14 @@
|
|||
openOVEditor(url) {
|
||||
window.showIFrameModal(url);
|
||||
},
|
||||
reloadAttachments() {
|
||||
this.$emit('attachment:uploaded');
|
||||
},
|
||||
openMarvinJsEditor() {
|
||||
MarvinJsEditor.initNewButton(
|
||||
this.$refs.marvinjsEditButton,
|
||||
this.reloadAttachments
|
||||
);
|
||||
$(this.$refs.marvinjsEditButton).trigger('click');
|
||||
},
|
||||
openScinoteEditor() {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
@attachment:viewMode="updateViewMode"
|
||||
@attachment:delete="deleteAttachment"
|
||||
@attachment:moved="attachmentMoved"
|
||||
@attachment:uploaded="reloadAttachments"
|
||||
/>
|
||||
</div>
|
||||
<template v-if="attachment.attributes.wopi">
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
@attachment:viewMode="updateViewMode"
|
||||
@attachment:delete="deleteAttachment"
|
||||
@attachment:moved="attachmentMoved"
|
||||
@attachment:uploaded="reloadAttachments"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ export default {
|
|||
HelperModule.flashAlertMsg(this.i18n.t('general.no_permissions'), 'danger');
|
||||
}
|
||||
});
|
||||
},
|
||||
reloadAttachments() {
|
||||
this.$emit('attachment:uploaded');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
:href="attachment.attributes.urls.edit_asset"
|
||||
id="wopi_file_edit_button"
|
||||
:class="attachment.attributes.wopi_context.edit_supported ? '' : 'disabled'"
|
||||
target="_blank"
|
||||
>
|
||||
<i class="sn-icon sn-icon-edit"></i>
|
||||
</a>
|
||||
|
|
@ -102,6 +103,7 @@
|
|||
@attachment:viewMode="updateViewMode"
|
||||
@attachment:delete="deleteAttachment"
|
||||
@attachment:moved="attachmentMoved"
|
||||
@attachment:uploaded="reloadAttachments"
|
||||
:withBorder="true"
|
||||
/>
|
||||
<deleteAttachmentModal
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ export default {
|
|||
this.uploadFiles(this.$refs.fileSelector.files);
|
||||
},
|
||||
openMarvinJsModal(button) {
|
||||
MarvinJsEditor.initNewButton('.new-marvinjs-upload-button', () => {
|
||||
this.loadAttachments
|
||||
});
|
||||
MarvinJsEditor.initNewButton('.new-marvinjs-upload-button', this.loadAttachments);
|
||||
button.click();
|
||||
},
|
||||
openWopiFileModal() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
export default function isInViewPort(el) {
|
||||
if (!el) return;
|
||||
|
||||
const rect = el.getBoundingClientRect();
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<span v-for="(item, i) in listItems" :key="i" class="contents">
|
||||
<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"
|
||||
:traget="item.url_target || '_self'"
|
||||
:target="item.url_target || '_self'"
|
||||
:class="{ 'bg-sn-super-light-blue': item.active }"
|
||||
:data-toggle="item.modalTarget && 'modal'"
|
||||
:data-target="item.modalTarget"
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="file-preview-container">
|
||||
<div class="file-preview-container <%= 'file-preview-container__wopi' if wopi_file?(asset) %>">
|
||||
<% if asset.previewable? %>
|
||||
<% if wopi_enabled? && wopi_file?(asset) %>
|
||||
<iframe class="wopi-file-preview" src="<%= asset.get_action_url(current_user, 'embedview') %>"></iframe>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue