Result page fixes [SCI-9731]

This commit is contained in:
Anton 2023-11-17 15:01:28 +01:00
parent 76e4dfc49d
commit 9be17cfaf3
2 changed files with 12 additions and 2 deletions

View file

@ -34,7 +34,7 @@
</li>
</ul>
</div>
<div class="result-toolbar__right flex items-center" @click="$emit('expandAll')">
<div class="result-toolbar__right flex items-center">
<button class="btn btn-secondary mr-3" @click="collapseResults" tabindex="0">
{{ i18n.t('my_modules.results.collapse_label') }}
</button>

View file

@ -48,7 +48,7 @@
@editingDisabled="disableEditMode"
@editingEnabled="enableEditMode"
/>
<div class="view-text-element" v-else-if="element.attributes.orderable.text_view" v-html="element.attributes.orderable.text_view"></div>
<div class="view-text-element" v-else-if="element.attributes.orderable.text_view" v-html="wrapTables"></div>
<div v-else class="text-sn-grey">
{{ i18n.t("protocols.steps.text.empty_text") }}
</div>
@ -112,6 +112,16 @@
})
},
computed: {
wrapTables() {
const container = $(`<span>${this.element.attributes.orderable.text_view}</span>`);
container.find('table').toArray().forEach((table) => {
if ($(table).parent().hasClass('table-wrapper')) return;
$(table).css('float', 'none').wrapAll(`
<div class="table-wrapper" style="overflow: auto; width: 100%"></div>
`);
});
return container.prop('outerHTML');
},
actionMenu() {
let menu = [];
if (this.element.attributes.orderable.urls.update_url) {