]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Разделение галлерей origin/feature_fomichev_erp-380_add_lightbox_to_image_bouquetr
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 16 Apr 2025 14:31:26 +0000 (17:31 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 16 Apr 2025 14:31:26 +0000 (17:31 +0300)
erp24/views/bouquet/index.php

index a017569a508a9c26dd96c91be26148e0db0e1320..a2a14bf5a30df98689340fce67f5fe7531ee26bf 100644 (file)
@@ -108,13 +108,14 @@ $this->title = 'Содержание матрицы';
                         $previewImageUrls = array_slice($allImageUrls, 0, 3);
                         $previewImageUrls += array_fill(0, 3 - count($previewImageUrls), null);
 
-                        $galleryId = 'gallery-' . $model->id;
+                        $imageGalleryId = 'gallery-images-' . $model->id;
+                        $videoGalleryId = 'gallery-video-' . $model->id;
 
                         $hiddenLinks = "";
                         if (count($allImageUrls) > 3) {
                             foreach (array_slice($allImageUrls, 3) as $url) {
                                 $hiddenLinks .= Html::a('', $url, [
-                                    'data-fancybox' => $galleryId,
+                                    'data-fancybox' => $imageGalleryId,
                                     'style'         => 'display:none;'
                                 ]);
                             }
@@ -161,7 +162,7 @@ $this->title = 'Содержание матрицы';
                                     'style' => 'width: 100%; height: 100%; object-fit: cover;',
                                 ]),
                                 $previewImageUrls[0],
-                                ['data-fancybox' => $galleryId]
+                                ['data-fancybox' => $imageGalleryId]
                             );
                         }
                         $html .= "
@@ -178,7 +179,7 @@ $this->title = 'Содержание матрицы';
                                 'javascript:;',
                                 [
                                     'style' => 'width: 100%; height: 100%; display:block;',
-                                    'data-fancybox' => $galleryId,
+                                    'data-fancybox' => $videoGalleryId,
                                     'data-src' => '<video controls style="width:100%; height:auto;">
                                 <source src="' . Url::to($model->presentation->url ?? null) . '" type="video/mp4">
                                </video>',
@@ -194,7 +195,7 @@ $this->title = 'Содержание матрицы';
                                     'style' => 'width: 100%; height: 100%; object-fit: cover;',
                                 ]),
                                 $previewImageUrls[1],
-                                ['data-fancybox' => $galleryId]
+                                ['data-fancybox' => $imageGalleryId]
                             );
                         }
                         $html .= "
@@ -211,7 +212,7 @@ $this->title = 'Содержание матрицы';
                                 'javascript:;',
                                 [
                                         'style' => 'width: 100%; height: 100%; display:block;',
-                                    'data-fancybox' => $galleryId,
+                                    'data-fancybox' => $videoGalleryId,
                                     'data-src' => '<video controls style="width:100%; height:auto;">
                                 <source src="' . Url::to($model->buildProcess->url ?? null) . '" type="video/mp4">
                                </video>',
@@ -227,7 +228,7 @@ $this->title = 'Содержание матрицы';
                                     'style' => 'width: 100%; height: 100%; object-fit: cover;'
                                 ]),
                                 $previewImageUrls[2],
-                                ['data-fancybox' => $galleryId]
+                                ['data-fancybox' => $imageGalleryId]
                             );
                         }
                         $html .= "