|
@@ -1784,10 +1784,10 @@
|
|
$modal.focus();
|
|
$modal.focus();
|
|
},
|
|
},
|
|
_setZoomContent: function ($frame, animate) {
|
|
_setZoomContent: function ($frame, animate) {
|
|
- var self = this, $content, tmplt, body, title, $body, $dataEl, config, pid = $frame.attr('id'),
|
|
|
|
- $modal = self.$modal, $prev = $modal.find('.btn-prev'), $next = $modal.find('.btn-next'), $tmp,
|
|
|
|
|
|
+ var self = this, $content, tmplt, body, title, $body, $dataEl, config, previewId = $frame.attr('id'),
|
|
|
|
+ $zoomPreview = self.$preview.find('#zoom-' + previewId), $modal = self.$modal, $tmp,
|
|
$btnFull = $modal.find('.btn-fullscreen'), $btnBord = $modal.find('.btn-borderless'), cap, size,
|
|
$btnFull = $modal.find('.btn-fullscreen'), $btnBord = $modal.find('.btn-borderless'), cap, size,
|
|
- $btnTogh = $modal.find('.btn-toggleheader'), $zoomPreview = self.$preview.find('#zoom-' + pid);
|
|
|
|
|
|
+ $btnTogh = $modal.find('.btn-toggleheader');
|
|
tmplt = $zoomPreview.attr('data-template') || 'generic';
|
|
tmplt = $zoomPreview.attr('data-template') || 'generic';
|
|
$content = $zoomPreview.find('.kv-file-content');
|
|
$content = $zoomPreview.find('.kv-file-content');
|
|
body = $content.length ? $content.html() : '';
|
|
body = $content.length ? $content.html() : '';
|
|
@@ -1820,12 +1820,12 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- $modal.data('previewId', pid);
|
|
|
|
- self._handler($prev, 'click', function () {
|
|
|
|
- self._zoomSlideShow('prev', pid);
|
|
|
|
|
|
+ $modal.data('previewId', previewId);
|
|
|
|
+ self._handler($modal.find('.btn-prev'), 'click', function () {
|
|
|
|
+ self._zoomSlideShow('prev', previewId);
|
|
});
|
|
});
|
|
- self._handler($next, 'click', function () {
|
|
|
|
- self._zoomSlideShow('next', pid);
|
|
|
|
|
|
+ self._handler($modal.find('.btn-next'), 'click', function () {
|
|
|
|
+ self._zoomSlideShow('next', previewId);
|
|
});
|
|
});
|
|
self._handler($btnFull, 'click', function () {
|
|
self._handler($btnFull, 'click', function () {
|
|
self._resizeZoomDialog(true);
|
|
self._resizeZoomDialog(true);
|
|
@@ -1860,12 +1860,13 @@
|
|
$modal.focus();
|
|
$modal.focus();
|
|
});
|
|
});
|
|
self._handler($modal, 'keydown', function (e) {
|
|
self._handler($modal, 'keydown', function (e) {
|
|
- var key = e.which || e.keyCode;
|
|
|
|
- if (key === 37 && !$prev.attr('disabled')) {
|
|
|
|
- self._zoomSlideShow('prev', pid);
|
|
|
|
|
|
+ var key = e.which || e.keyCode, $prev = $(this).find('.btn-prev'), $next = $(this).find('.btn-next'),
|
|
|
|
+ vId = $(this).data('previewId'), vPrevKey = self.rtl ? 39 : 37, vNextKey = self.rtl ? 37 : 39;
|
|
|
|
+ if (key === vPrevKey && $prev.length && !$prev.attr('disabled')) {
|
|
|
|
+ self._zoomSlideShow('prev', vId);
|
|
}
|
|
}
|
|
- if (key === 39 && !$next.attr('disabled')) {
|
|
|
|
- self._zoomSlideShow('next', pid);
|
|
|
|
|
|
+ if (key === vNextKey && $next.length && !$next.attr('disabled')) {
|
|
|
|
+ self._zoomSlideShow('next', vId);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|