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