mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Fixed attachments slideshow
This commit is contained in:
parent
df3a8182c3
commit
2d1d71b147
2 changed files with 10 additions and 5 deletions
|
|
@ -582,9 +582,10 @@
|
|||
if (this.pswpDom)
|
||||
{
|
||||
oDom
|
||||
.on('click', '.attachmentImagePreview[data-index]', function (oEvent) {
|
||||
.on('click', '.attachmentImagePreview.visible', function (oEvent) {
|
||||
|
||||
var
|
||||
iIndex = 0,
|
||||
oPs = null,
|
||||
oEl = oEvent.currentTarget || null,
|
||||
aItems = []
|
||||
|
|
@ -601,14 +602,18 @@
|
|||
// }
|
||||
;
|
||||
|
||||
oDom.find('.attachmentImagePreview[data-index]').each(function (index, oSubElement) {
|
||||
oDom.find('.attachmentImagePreview.visible').each(function (index, oSubElement) {
|
||||
|
||||
var
|
||||
$oItem = $(oSubElement)
|
||||
;
|
||||
|
||||
if (oEl === oSubElement)
|
||||
{
|
||||
iIndex = index;
|
||||
}
|
||||
|
||||
aItems.push({
|
||||
// 'el': $oItem,
|
||||
'w': 600, 'h': 400,
|
||||
'src': $oItem.attr('href'),
|
||||
'title': $oItem.attr('title') || ''
|
||||
|
|
@ -620,7 +625,7 @@
|
|||
Globals.useKeyboardShortcuts(false);
|
||||
|
||||
oPs = new PhotoSwipe(self.pswpDom, PhotoSwipeUI_Default, aItems, {
|
||||
'index': Utils.pInt($(oEl).data('index')),
|
||||
'index': iIndex,
|
||||
'bgOpacity': 0.85,
|
||||
'loadingIndicatorDelay': 500,
|
||||
'errorMsg': '<div class="pswp__error-msg">' + sErrorMessage + '</div>',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue