aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-custom-markup/custom-markup.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-09 10:31:27 +0200
committerChocobozzz <me@florianbigard.com>2021-06-09 10:31:27 +0200
commit61cbafc1f80a33a895b54b15751a42e0d78af231 (patch)
tree4ecbd18133550053afe0d12441030f8a1c257511 /client/src/app/shared/shared-custom-markup/custom-markup.service.ts
parent9105634f16e5dfc66df198f23dbfae77dff2d821 (diff)
downloadPeerTube-61cbafc1f80a33a895b54b15751a42e0d78af231.tar.gz
PeerTube-61cbafc1f80a33a895b54b15751a42e0d78af231.tar.zst
PeerTube-61cbafc1f80a33a895b54b15751a42e0d78af231.zip
Improve channel card custom markup
Diffstat (limited to 'client/src/app/shared/shared-custom-markup/custom-markup.service.ts')
-rw-r--r--client/src/app/shared/shared-custom-markup/custom-markup.service.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts
index db5f64ee8..aa5dbe643 100644
--- a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts
+++ b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts
@@ -122,7 +122,13 @@ export class CustomMarkupService {
122 const data = el.dataset as ChannelMiniatureMarkupData 122 const data = el.dataset as ChannelMiniatureMarkupData
123 const component = this.dynamicElementService.createElement(ChannelMiniatureMarkupComponent) 123 const component = this.dynamicElementService.createElement(ChannelMiniatureMarkupComponent)
124 124
125 this.dynamicElementService.setModel(component, { name: data.name }) 125 const model = {
126 name: data.name,
127 displayLatestVideo: this.buildBoolean(data.displayLatestVideo) ?? true,
128 displayDescription: this.buildBoolean(data.displayDescription) ?? true
129 }
130
131 this.dynamicElementService.setModel(component, model)
126 132
127 return component 133 return component
128 } 134 }
@@ -178,7 +184,12 @@ export class CustomMarkupService {
178 const data = el.dataset as ContainerMarkupData 184 const data = el.dataset as ContainerMarkupData
179 185
180 const root = document.createElement('div') 186 const root = document.createElement('div')
181 root.classList.add('peertube-container') 187
188 const layoutClass = data.layout
189 ? 'layout-' + data.layout
190 : 'layout-row'
191
192 root.classList.add('peertube-container', layoutClass)
182 193
183 if (data.width) { 194 if (data.width) {
184 root.setAttribute('width', data.width) 195 root.setAttribute('width', data.width)