Skip to content

Commit

Permalink
Fix copy button in plain text tab under "Use your license" (#235)
Browse files Browse the repository at this point in the history
* Use classes instead of IDs for styling in LicenseCopy component

* Add additional class to textarea for HTML code to override Bulma styles

* Use separate IDs between web and print/plain text tabs in LicenseCopy
  • Loading branch information
ObjectBoxPC authored Nov 28, 2020
1 parent 8e2f7cd commit 1eac9c2
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/components/LicenseCopy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
class="attribution-tab"
>
<b-tab-item :label="this.$t(firstTabLabel)">
<div id="attribution-text">
<div
:id="textAttributionId"
class="attribution-text"
>
<LicenseCode :attribution-type="textAttributionType" />
</div>
</b-tab-item>
Expand All @@ -14,12 +17,11 @@
:label="this.$t('license-use.html-label')"
>
<div
id="generated-html-container"
class="control"
class="generated-html-container control"
>
<textarea
id="attribution-html"
class="textarea"
:id="htmlAttributionId"
class="attribution-html-textarea textarea"
:value="htmlLicenseParagraph"
readonly
/>
Expand Down Expand Up @@ -78,6 +80,15 @@ export default {
firstTabLabel() {
return this.isWeb ? 'license-use.rich-text-label' : 'license-use.plain-text-label'
},
attributionIdPrefix() {
return this.isWeb ? 'attribution-web-' : 'attribution-print-'
},
textAttributionId() {
return `${this.attributionIdPrefix}-text`
},
htmlAttributionId() {
return `${this.attributionIdPrefix}-html`
},
textAttributionType() {
return this.isWeb ? 'web' : 'print'
},
Expand Down Expand Up @@ -151,7 +162,7 @@ export default {
e.clearSelection()
},
clipboardTarget() {
return `#attribution-${this.currentSelection}`
return `#${this.attributionIdPrefix}-${this.currentSelection}`
}
}
}
Expand All @@ -165,18 +176,18 @@ export default {
height: 1.4rem;
}
#attribution-text p {
.attribution-text p {
margin-top: 0.5rem;
margin-bottom: 1rem;
background-color: #fff;
padding: 24px 0 0 24px;
height: 100px;
}
#generated-html-container {
.generated-html-container {
padding-top: 10px;
padding-bottom: 10px;
}
#generated-html-container textarea {
.generated-html-container .attribution-html-textarea.textarea {
word-break: break-all;
-ms-word-break: break-all;
min-height: 60px;
Expand Down

0 comments on commit 1eac9c2

Please sign in to comment.