From c197de9248c6cb04b9f6023ce2329ce641fef893 Mon Sep 17 00:00:00 2001 From: rohitmathur-7 Date: Thu, 30 Jan 2025 16:19:43 +0530 Subject: [PATCH] Add condition so that when comment is added on media in gallery shortcode then the gallery does not reload --- app/assets/js/rtMedia.backbone.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/js/rtMedia.backbone.js b/app/assets/js/rtMedia.backbone.js index 5ea033882..21441bb0e 100755 --- a/app/assets/js/rtMedia.backbone.js +++ b/app/assets/js/rtMedia.backbone.js @@ -1898,8 +1898,9 @@ jQuery( document ).ready( function( $ ) { /** Scroll function called */ rtMediaScrollComments(); + const hasGalleryShortCodeTitle = !!$('.rtm-gallery-shortcode-title-container', 'body').length; /** refreshing fragments */ - if ( false == $( 'body' ).hasClass( 'activity' ) && false == $( 'body' ).hasClass( 'groups' ) ) { + if ( false == $( 'body' ).hasClass( 'activity' ) && false == $( 'body' ).hasClass( 'groups' ) && !hasGalleryShortCodeTitle ) { galleryObj.reloadView(); } },