diff --git a/app/assets/stylesheets/label_templates/show.scss b/app/assets/stylesheets/label_templates/show.scss index 53b699487..97c01d1d0 100644 --- a/app/assets/stylesheets/label_templates/show.scss +++ b/app/assets/stylesheets/label_templates/show.scss @@ -13,7 +13,7 @@ border-bottom: $border-tertiary; display: flex; margin-left: -2em; - padding: .5em 2em; + padding: .25em 2em; width: calc(100% + 4em); .label-template-icon { @@ -32,7 +32,7 @@ .template-descripiton { @include font-button; - margin: 1em 0; + margin: .5em 0; .title { font-weight: bold; @@ -126,6 +126,10 @@ top: 0; } + &.read-only { + cursor: initial; + } + &:hover:not(.read-only) { background-color: $color-concrete; diff --git a/app/assets/stylesheets/partials/_sidebar.scss b/app/assets/stylesheets/partials/_sidebar.scss index 4f76b88a6..a25762d7c 100644 --- a/app/assets/stylesheets/partials/_sidebar.scss +++ b/app/assets/stylesheets/partials/_sidebar.scss @@ -163,7 +163,6 @@ background: $color-white; color: $brand-primary; font-weight: bold; - pointer-events: none; } .fa-folder { diff --git a/app/assets/stylesheets/shared/dropdown_selector.scss b/app/assets/stylesheets/shared/dropdown_selector.scss index 76c964eac..a0fc99232 100644 --- a/app/assets/stylesheets/shared/dropdown_selector.scss +++ b/app/assets/stylesheets/shared/dropdown_selector.scss @@ -38,6 +38,7 @@ .right-icon { color: $color-volcano; cursor: pointer; + height: 18px; line-height: 18px; position: absolute; right: 12px; diff --git a/app/javascript/vue/label_template/container.vue b/app/javascript/vue/label_template/container.vue index 6a85d40e2..965ed9b31 100644 --- a/app/javascript/vue/label_template/container.vue +++ b/app/javascript/vue/label_template/container.vue @@ -46,7 +46,7 @@ @update="updateDescription" /> @@ -240,6 +240,11 @@ let textAfter = this.newContent.substring(this.cursorPos, this.newContent.length); this.newContent = textBefore + field + textAfter; this.cursorPos = this.cursorPos + field.length; + + this.$nextTick(() => { + $(this.$refs.contentInput).prop('selectionStart', this.cursorPos); + $(this.$refs.contentInput).prop('selectionEnd', this.cursorPos); + }); }, showErrors() { if (this.editingContent) { diff --git a/config/locales/en.yml b/config/locales/en.yml index 53068f4ec..fadb8a807 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -871,6 +871,7 @@ en: description_error_prefix: 'Label template description' description_title: 'Template description' description_placeholder: 'Enter the template description (optional)' + description_empty: 'No template description' content_title: '%{format} template code' preview_title: 'Template preview' view_content_tooltip: 'Click to edit template code'