Lines Matching refs:_this5
540 var _this5 = this;
553 …_this5.relatedElements[_this5.currentImageIndex].dispatchEvent(new Event('error.' + _this5.eventNa…
554 _this5.isAnimating = false;
555 _this5.isOpen = true;
556 _this5.domNodes.spinner.style.display = 'none';
558 if (_this5.initialImageIndex === _this5.currentImageIndex && dirIsDefined) {
559 return _this5.close();
561 if (_this5.options.alertError) {
562 alert(_this5.options.alertErrorMessage);
564 _this5.loadImage(dirIsDefined ? direction : 1);
568 …_this5.relatedElements[_this5.currentImageIndex].dispatchEvent(new Event('changed.' + _this5.event…
569 …_this5.relatedElements[_this5.currentImageIndex].dispatchEvent(new Event((direction === 1 ? 'nextD…
573 if (_this5.options.history) {
574 _this5.updateURL();
576 if (_this5.loadedImages.indexOf(_this5.currentImage.getAttribute('src')) === -1) {
577 _this5.loadedImages.push(_this5.currentImage.getAttribute('src'));
581 … if (_this5.options.scaleImageToRatio || imageWidth > windowWidth || imageHeight > windowHeight) {
586 _this5.domNodes.image.style.top = (window.innerHeight - imageHeight) / 2 + 'px';
587 …_this5.domNodes.image.style.left = (window.innerWidth - imageWidth - _this5.globalScrollbarWidth) …
588 _this5.domNodes.image.style.width = imageWidth + 'px';
589 _this5.domNodes.image.style.height = imageHeight + 'px';
590 _this5.domNodes.spinner.style.display = 'none';
591 if (_this5.options.focus) {
592 _this5.forceFocus();
594 _this5.fadeIn(_this5.currentImage, _this5.options.fadeSpeed, function () {
595 if (_this5.options.focus) {
596 _this5.domNodes.wrapper.focus();
599 _this5.isOpen = true;
601 if (typeof _this5.options.captionSelector === 'string') {
602 …= _this5.options.captionSelector === 'self' ? _this5.relatedElements[_this5.currentImageIndex] : _…
603 } else if (typeof _this5.options.captionSelector === 'function') {
604 …captionContainer = _this5.options.captionSelector(_this5.relatedElements[_this5.currentImageIndex]…
606 if (_this5.options.captions && captionContainer) {
607 if (_this5.options.captionType === 'data') {
608 captionText = captionContainer.dataset[_this5.options.captionsData];
609 } else if (_this5.options.captionType === 'text') {
612 captionText = captionContainer.getAttribute(_this5.options.captionsData);
615 if (!_this5.options.loop) {
616 if (_this5.currentImageIndex === 0) {
617 _this5.hide(_this5.domNodes.navigation.querySelector('.sl-prev'));
619 if (_this5.currentImageIndex >= _this5.relatedElements.length - 1) {
620 _this5.hide(_this5.domNodes.navigation.querySelector('.sl-next'));
622 if (_this5.currentImageIndex > 0) {
623 _this5.show(_this5.domNodes.navigation.querySelector('.sl-prev'));
625 if (_this5.currentImageIndex < _this5.relatedElements.length - 1) {
626 _this5.show(_this5.domNodes.navigation.querySelector('.sl-next'));
629 if (_this5.relatedElements.length === 1) {
630 _this5.hide(_this5.domNodes.navigation.querySelectorAll('.sl-prev, .sl-next'));
632 _this5.show(_this5.domNodes.navigation.querySelectorAll('.sl-prev, .sl-next'));
636 if (_this5.options.animationSlide) {
637 _this5.slide(0, 100 * direction + 'px');
639 _this5.slide(_this5.options.animationSpeed / 1000, 0 + 'px');
642 _this5.fadeIn(_this5.domNodes.image, _this5.options.fadeSpeed, function () {
643 _this5.isAnimating = false;
644 _this5.setCaption(captionText, imageWidth);
647 _this5.isAnimating = false;
648 _this5.setCaption(captionText, imageWidth);
650 if (_this5.options.additionalHtml && !_this5.domNodes.additionalHtml) {
651 _this5.domNodes.additionalHtml = document.createElement('div');
652 _this5.domNodes.additionalHtml.classList.add('sl-additional-html');
653 _this5.domNodes.additionalHtml.innerHTML = _this5.options.additionalHtml;
654 _this5.domNodes.image.appendChild(_this5.domNodes.additionalHtml);
656 if (_this5.options.download) {
657 … _this5.domNodes.downloadLink.setAttribute('href', _this5.currentImage.getAttribute('src'));