@@ -292,7 +292,7 @@ export default {
292292 // Open Edit Dialog
293293 this .$event .publish (" dialog.edit" , { selection, album: this .album , index, tab });
294294 },
295- openPhoto (index , showMerged = false , preferVideo = false ) {
295+ openPhoto (index , showMerged = false ) {
296296 if (this .loading || ! this .listen || this .lightbox .loading || ! this .results [index]) {
297297 return false ;
298298 }
@@ -304,20 +304,6 @@ export default {
304304 showMerged = false ;
305305 }
306306
307- /**
308- * If the file is a video or an animation (like gif), then we always play
309- * it in the video-player.
310- * If the file is a live-image (an image with an embedded video), then we only
311- * play it in the video-player if specifically requested.
312- * This is because:
313- * 1. the lower-resolution video in these files is already
314- * played when hovering the element (which does not happen for regular
315- * video files)
316- * 2. The video in live-images is an addon. The main focus is usually still
317- * the high resolution image inside
318- *
319- * preferVideo is true, when the user explicitly clicks the live-image-icon.
320- */
321307 if (showMerged) {
322308 this .$lightbox .openModels (Thumb .fromFiles ([selected]), 0 );
323309 } else {
@@ -326,8 +312,10 @@ export default {
326312
327313 return true ;
328314 },
329- loadMore () {
330- if (this .scrollDisabled || this .$view .isHidden (this )) return ;
315+ loadMore (force ) {
316+ if (! force && (this .scrollDisabled || this .$view .isHidden (this ))) {
317+ return ;
318+ }
331319
332320 this .scrollDisabled = true ;
333321 this .listen = false ;
@@ -434,10 +422,11 @@ export default {
434422
435423 if (this .model .Order !== this .filter .order ) {
436424 this .model .Order = this .filter .order ;
437- this .updateAlbum ();
438425 }
439426
440- if (this .loading ) return ;
427+ if (this .loading ) {
428+ return ;
429+ }
441430
442431 const query = {
443432 view: this .settings .view ,
@@ -487,6 +476,15 @@ export default {
487476 this .loadMore ();
488477 },
489478 search () {
479+ /**
480+ * search is called on mount or route change. If the route changed to an
481+ * open lightbox, no search is required. There is no reason to do an
482+ * initial results load, if the results aren't currently visible
483+ */
484+ if (this .lightbox .open ) {
485+ return ;
486+ }
487+
490488 this .scrollDisabled = true ;
491489
492490 // Don't query the same data more than once
@@ -587,7 +585,7 @@ export default {
587585 this .filter .order = this .model .Order ;
588586 this .updateQuery ();
589587 } else {
590- this .loadMore ();
588+ this .loadMore (true );
591589 }
592590
593591 return ;
@@ -623,7 +621,9 @@ export default {
623621 }
624622 },
625623 onUpdate (ev , data ) {
626- if (! this .listen ) return ;
624+ if (! this .listen ) {
625+ return ;
626+ }
627627
628628 if (! data || ! data .entities ) {
629629 return ;
0 commit comments