Skip to content

Commit 7291525

Browse files
committed
summernote thumbnail open correct photoswipe element
1 parent f0713b1 commit 7291525

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/Traits/Attachments.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ protected function createAttachmentsFrom($html, $ticket, $comment = false, $coun
8787
$link->setAttribute('href', \URL::route(Setting::grab('main_route').'.view-attachment', [$attachment->id]));
8888
$link->setAttribute('class', 'summernote_thumbnail_link tooltip-show');
8989
$link->setAttribute('title', $original_filename);
90-
$link->setAttribute('data-pwsp-pid', $attachment->id);
91-
9290

9391
// Append thumbnail in link
9492
$link->appendChild($child_img);

src/Views/shared/photoswipe_files.blade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@
7777
// Modify link for each image in ticket to launch PhotoSwipe
7878
$('.pwsp_gallery_link, .summernote_thumbnail_link').click(function(e){
7979
var openpid = $(this).data('pwsp-pid');
80+
if (typeof openpid === 'undefined' || openpid == ""){
81+
var parts = $(this).prop('href').split('/');
82+
openpid = Number(parts[parts.length -1]);
83+
}
84+
8085
var openindex = 0;
8186
8287
for (var i = 0, len = pswpItems.length; i < len; i++) {

0 commit comments

Comments
 (0)