Browse Source

refactor(AdvancedTable): Bulk actions popup size overwrite prop

Owen Diffey 2 years ago
parent
commit
10e0dc9c70

+ 18 - 6
frontend/src/components/AdvancedTable.vue

@@ -708,7 +708,9 @@
 			class="bulk-popup"
 			:style="{
 				top: dragBox.top + 'px',
-				left: dragBox.left + 'px'
+				left: dragBox.left + 'px',
+				width: dragBox.width + 'px',
+				height: dragBox.height + 'px'
 			}"
 			ref="bulk-popup"
 		>
@@ -780,7 +782,8 @@ export default {
 		maxWidth: { type: Number, default: 1880 },
 		query: { type: Boolean, default: true },
 		keyboardShortcuts: { type: Boolean, default: true },
-		events: { type: Object, default: () => {} }
+		events: { type: Object, default: () => {} },
+		bulkActions: { type: Object, default: () => {} }
 	},
 	data() {
 		return {
@@ -1864,12 +1867,21 @@ export default {
 				// Only change the position if the popup is actually visible
 				if (this.selectedRows.length === 0) return;
 
+				const bulkActions = {
+					height: 46,
+					width: 400,
+					...this.bulkActions
+				};
+
 				this.setInitialBox(
 					{
-						top: document.body.clientHeight - 56,
-						left: document.body.clientWidth / 2 - 200,
-						width: 400,
-						height: 50
+						top:
+							document.body.clientHeight -
+							bulkActions.height -
+							10,
+						left:
+							(document.body.clientWidth - bulkActions.width) / 2,
+						...bulkActions
 					},
 					true
 				);

+ 1 - 0
frontend/src/pages/Admin/YouTube/Videos.vue

@@ -18,6 +18,7 @@
 			data-action="youtube.getVideos"
 			name="admin-youtube-videos"
 			:max-width="1140"
+			:bulk-actions="{ width: 150 }"
 		>
 			<template #column-options="slotProps">
 				<div class="row-options">