From ac0fe4389d12329275ca7d6dd9735eb667a6379b Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 20 Oct 2022 10:55:42 +0200 Subject: [PATCH] Fix label preview in print modal [SCI-7367] --- .../repository/repository_print_label_modal.scss | 4 ++++ .../vue/label_template/components/label_preview.vue | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/app/assets/stylesheets/repository/repository_print_label_modal.scss b/app/assets/stylesheets/repository/repository_print_label_modal.scss index 80d5884ae..80a3e17b6 100644 --- a/app/assets/stylesheets/repository/repository_print_label_modal.scss +++ b/app/assets/stylesheets/repository/repository_print_label_modal.scss @@ -70,6 +70,10 @@ justify-content: center; min-height: 200px; padding: .5em 0; + + img { + max-width: 100%; + } } .label-template-option { diff --git a/app/javascript/vue/label_template/components/label_preview.vue b/app/javascript/vue/label_template/components/label_preview.vue index 5dc55ceec..4d6112380 100644 --- a/app/javascript/vue/label_template/components/label_preview.vue +++ b/app/javascript/vue/label_template/components/label_preview.vue @@ -130,6 +130,14 @@ }, zpl() { this.refreshPreview(); + }, + template() { + this.width = this.template.attributes.unit == 'in' ? this.template.attributes.width_mm / 25.4 : this.template.attributes.width_mm + this.height = this.template.attributes.unit == 'in' ? this.template.attributes.height_mm / 25.4 : this.template.attributes.height_mm + this.unit = this.template.attributes.unit + this.density = this.template.attributes.density + + this.refreshPreview() } }, methods: {