Skip to content

Commit

Permalink
fixed error for text case
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Aug 25, 2024
1 parent 98c21b4 commit 74a8f89
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/app/src/components/detail/attachments/comparison.vue
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,11 @@ const updateGutter = ($gutter) => {
const initGutter = () => {
const $gutter = gutter.value;
// there is no $gutter if not image to comparison, only text
if (!$gutter) {
return;
}
updateGutter($gutter);
const sme = new SME($gutter);
Expand Down Expand Up @@ -468,6 +473,10 @@ const updateOpacity = (imageStyle) => {
const initOpacity = () => {
const $el = el.value;
const $opacity = $el.querySelector('.mcr-comparison-opacity');
// only image list
if (!$opacity) {
return;
}
const sme = new SME($opacity);
sme.bind(SME.START, (e) => {
if (d.tabIndex === 4) {
Expand Down Expand Up @@ -641,6 +650,12 @@ watch([
});
onMounted(() => {
// only for image list
if (!d.imageList) {
return;
}
updateCurrentTabContainer();
initEvents();
initGutter();
Expand Down Expand Up @@ -757,6 +772,7 @@ onUnmounted(() => {
</VuiTab>

<VuiFlex
v-if="d.imageList"
class="mcr-comparison-toolbar"
align="space-between"
padding="5px 10px 10px 10px"
Expand Down

0 comments on commit 74a8f89

Please sign in to comment.