@@ -143,8 +143,8 @@ const batchOptionsProps = computed(() => ({
-
-
+
+
diff --git a/src/composables/photos/editor/crop.js b/src/composables/photos/editor/crop.js
index 3d0577b..0d446c2 100644
--- a/src/composables/photos/editor/crop.js
+++ b/src/composables/photos/editor/crop.js
@@ -8,45 +8,48 @@ export const croppedArea = ref(null);
export const selectedAspectRatio = ref(null);
watch(() => selectedAspectRatio.value, (newVal) => {
- cropper.setAspectRatio(newVal);
+ cropper.setAspectRatio(newVal);
})
-export const setCropData = () => {
- const [w, h] = cropperImgSizes.value;
- const cropData = cropper.getCropBoxData();
- croppedArea.value = {
- left: roundWithPrecision(cropData.left / w, 5),
- top: roundWithPrecision(cropData.top / h, 5),
- width: roundWithPrecision(cropData.width / w, 5),
- height: roundWithPrecision(cropData.height / h, 5)
- };
+export const setCropData = () => {
+ const [w, h] = cropperImgSizes.value;
+
+ console.log("crop end");
+
+ const cropData = cropper.getCropBoxData();
+ croppedArea.value = {
+ left: roundWithPrecision(cropData.left / w, 5),
+ top: roundWithPrecision(cropData.top / h, 5),
+ width: roundWithPrecision(cropData.width / w, 5),
+ height: roundWithPrecision(cropData.height / h, 5)
+ };
}
export const aspectRatioOptions = computed(() =>
- [
- {label: '16:9', value: roundWithPrecision(16 / 9, 5)},
- {label: '4:3', value: roundWithPrecision(4 / 3, 5)},
- {label: '9:16', value: roundWithPrecision(9 / 16, 5)},
- {label: '3:4', value: roundWithPrecision(3 / 4, 5)},
- {label: '1:1', value: 1},
- {label: 'Volný', value: null},
- {label: 'Původní', value: roundWithPrecision(photoAspectRatio.value, 5)},
- ]
+ [
+ {label: '16:9', value: roundWithPrecision(16 / 9, 5)},
+ {label: '4:3', value: roundWithPrecision(4 / 3, 5)},
+ {label: '9:16', value: roundWithPrecision(9 / 16, 5)},
+ {label: '3:4', value: roundWithPrecision(3 / 4, 5)},
+ {label: '1:1', value: 1},
+ {label: 'Volný', value: null},
+ {label: 'Původní', value: roundWithPrecision(photoAspectRatio.value, 5)},
+ ]
);
export const cropperReady = (e) => {
- if (croppedArea.value) {
- const [w, h] = cropperImgSizes.value;
- selectedAspectRatio.value = roundWithPrecision((croppedArea.value.width * w) / (croppedArea.value.height * h), 5);
+ if (croppedArea.value) {
+ const [w, h] = cropperImgSizes.value;
+ selectedAspectRatio.value = roundWithPrecision((croppedArea.value.width * w) / (croppedArea.value.height * h), 5);
- cropper.setCropBoxData({
- left: croppedArea.value.left * w,
- top: croppedArea.value.top * h,
- width: croppedArea.value.width * w,
- height: croppedArea.value.height * h
- });
- } else {
- selectedAspectRatio.value = roundWithPrecision(photoAspectRatio.value, 5);
- }
+ cropper.setCropBoxData({
+ left: croppedArea.value.left * w,
+ top: croppedArea.value.top * h,
+ width: croppedArea.value.width * w,
+ height: croppedArea.value.height * h
+ });
+ } else {
+ selectedAspectRatio.value = roundWithPrecision(photoAspectRatio.value, 5);
+ }
}
diff --git a/src/composables/photos/photo.js b/src/composables/photos/photo.js
deleted file mode 100644
index 5392a1c..0000000
--- a/src/composables/photos/photo.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import {ref} from "vue";
-import {flight} from "src/composables/objects/flight";
-
-export const openPhotoDetail = ref(false);
-export const photoData = ref(null);
-export const openDetail = ({photo, idx, allPhotos}) => {
- openPhotoDetail.value = true;
- photoData.value = {photo, idx, allPhotos};
-}
-export const openPhotoFromList = ({photo, idx}) => {
- openDetail({photo, idx, allPhotos: flight.value.photos});
-}
diff --git a/src/pages/profile/flight/FlightDetailPage.vue b/src/pages/profile/flight/FlightDetailPage.vue
index a804079..8fdcd06 100644
--- a/src/pages/profile/flight/FlightDetailPage.vue
+++ b/src/pages/profile/flight/FlightDetailPage.vue
@@ -69,11 +69,6 @@ const copyLinkToClipboard = () => {
-
-
-
-
-
{{ flightName(flight) }}
diff --git a/src/pages/profile/flight/PhotoEditorPage.vue b/src/pages/profile/flight/PhotoEditorPage.vue
index 4915d1c..c6df1db 100644
--- a/src/pages/profile/flight/PhotoEditorPage.vue
+++ b/src/pages/profile/flight/PhotoEditorPage.vue
@@ -1,6 +1,6 @@