aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-07 11:08:56 +0200
committerChocobozzz <me@florianbigard.com>2019-06-07 11:08:56 +0200
commitf238aec54f93bf6ef73ef17be23159ecd1d83f96 (patch)
tree963d67dc8d57c85b09d15135d6e46178378d1d22 /client/src/app/shared
parent3ddb1ec5553167b0b1cb852e906a691ea65522a4 (diff)
downloadPeerTube-f238aec54f93bf6ef73ef17be23159ecd1d83f96.tar.gz
PeerTube-f238aec54f93bf6ef73ef17be23159ecd1d83f96.tar.zst
PeerTube-f238aec54f93bf6ef73ef17be23159ecd1d83f96.zip
Fix video action dropdown
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/buttons/action-dropdown.component.ts6
-rw-r--r--client/src/app/shared/video/video-actions-dropdown.component.ts32
2 files changed, 14 insertions, 24 deletions
diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.ts
index f5345831b..c9dbbfda2 100644
--- a/client/src/app/shared/buttons/action-dropdown.component.ts
+++ b/client/src/app/shared/buttons/action-dropdown.component.ts
@@ -41,10 +41,4 @@ export class ActionDropdownComponent<T> {
41 areActionsDisplayed (actions: DropdownAction<T>[], entry: T) { 41 areActionsDisplayed (actions: DropdownAction<T>[], entry: T) {
42 return actions.some(a => a.isDisplayed === undefined || a.isDisplayed(entry)) 42 return actions.some(a => a.isDisplayed === undefined || a.isDisplayed(entry))
43 } 43 }
44
45 handleClick (event: Event, action: DropdownAction<T>) {
46 event.preventDefault()
47
48 // action.handler(entry)
49 }
50} 44}
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts
index 0bbc783c1..8d4e33697 100644
--- a/client/src/app/shared/video/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/video/video-actions-dropdown.component.ts
@@ -188,19 +188,16 @@ export class VideoActionsDropdownComponent implements OnChanges {
188 } 188 }
189 189
190 private buildActions () { 190 private buildActions () {
191 this.videoActions = [] 191 this.videoActions = [
192 192 [
193 if (this.authService.isLoggedIn()) {
194 this.videoActions.push([
195 { 193 {
196 label: this.i18n('Save to playlist'), 194 label: this.i18n('Save to playlist'),
197 handler: () => this.playlistDropdown.toggle(), 195 handler: () => this.playlistDropdown.toggle(),
198 isDisplayed: () => this.displayOptions.playlist, 196 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.playlist,
199 iconName: 'playlist-add' 197 iconName: 'playlist-add'
200 } 198 }
201 ]) 199 ],
202 200 [
203 this.videoActions.push([
204 { 201 {
205 label: this.i18n('Download'), 202 label: this.i18n('Download'),
206 handler: () => this.showDownloadModal(), 203 handler: () => this.showDownloadModal(),
@@ -211,36 +208,35 @@ export class VideoActionsDropdownComponent implements OnChanges {
211 label: this.i18n('Update'), 208 label: this.i18n('Update'),
212 linkBuilder: ({ video }) => [ '/videos/update', video.uuid ], 209 linkBuilder: ({ video }) => [ '/videos/update', video.uuid ],
213 iconName: 'edit', 210 iconName: 'edit',
214 isDisplayed: () => this.displayOptions.update && this.isVideoUpdatable() 211 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.update && this.isVideoUpdatable()
215 }, 212 },
216 { 213 {
217 label: this.i18n('Blacklist'), 214 label: this.i18n('Blacklist'),
218 handler: () => this.showBlacklistModal(), 215 handler: () => this.showBlacklistModal(),
219 iconName: 'no', 216 iconName: 'no',
220 isDisplayed: () => this.displayOptions.blacklist && this.isVideoBlacklistable() 217 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoBlacklistable()
221 }, 218 },
222 { 219 {
223 label: this.i18n('Unblacklist'), 220 label: this.i18n('Unblacklist'),
224 handler: () => this.unblacklistVideo(), 221 handler: () => this.unblacklistVideo(),
225 iconName: 'undo', 222 iconName: 'undo',
226 isDisplayed: () => this.displayOptions.blacklist && this.isVideoUnblacklistable() 223 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.blacklist && this.isVideoUnblacklistable()
227 }, 224 },
228 { 225 {
229 label: this.i18n('Delete'), 226 label: this.i18n('Delete'),
230 handler: () => this.removeVideo(), 227 handler: () => this.removeVideo(),
231 isDisplayed: () => this.displayOptions.delete && this.isVideoRemovable(), 228 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.delete && this.isVideoRemovable(),
232 iconName: 'delete' 229 iconName: 'delete'
233 } 230 }
234 ]) 231 ],
235 232 [
236 this.videoActions.push([
237 { 233 {
238 label: this.i18n('Report'), 234 label: this.i18n('Report'),
239 handler: () => this.showReportModal(), 235 handler: () => this.showReportModal(),
240 isDisplayed: () => this.displayOptions.report, 236 isDisplayed: () => this.authService.isLoggedIn() && this.displayOptions.report,
241 iconName: 'alert' 237 iconName: 'alert'
242 } 238 }
243 ]) 239 ]
244 } 240 ]
245 } 241 }
246} 242}