From ae961f208d45e2fb892c0d181bd6ad8b48940856 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 11 Nov 2022 12:53:33 -0700 Subject: [PATCH] Fix a few js errors in expose --- api/js/etemplate/Expose/ExposeMixin.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Expose/ExposeMixin.ts b/api/js/etemplate/Expose/ExposeMixin.ts index cc86799878..bce0bacfff 100644 --- a/api/js/etemplate/Expose/ExposeMixin.ts +++ b/api/js/etemplate/Expose/ExposeMixin.ts @@ -608,7 +608,7 @@ export function ExposeMixin>(superclass : B) return; } // Remove the loading class if the slide is loaded - else + else if(this._gallery.slides[index]) { this._gallery.slides[index].classList.remove(this._gallery.options.slideLoadingClass); } @@ -637,7 +637,10 @@ export function ExposeMixin>(superclass : B) // Move into place in DOM let node = this._gallery[var_name][index]; node.setAttribute('data-index', index) - this._gallery.slidesContainer[0].insertBefore(this._gallery.slides[(index + 1)], undefined); + if(this._gallery.slides[(index + 1)]) + { + this._gallery.slidesContainer[0].insertBefore(this._gallery.slides[(index + 1)], undefined); + } if(active) { node.classList.add(this._gallery.options.activeIndicatorClass);