• Resolved Nazar78

    (@nazar78)


    Exception:line:1473 Unable to get property ‘opened’ of undefined or null reference

    JS:/wordpress/wp-content/plugins/jetpack/modules/carousel/jetpack-carousel.js

    Using JetPack Gallery Widget, on pages with hashtag bookmark reference i.e. https://domain.com/#hashtag will raise JS exception due to variable ‘gallery’ not yet defined. This caused the photos in the widget not loading. Hope you guys can fix in the next release. I did a quick fix by adding checks for variable ‘gallery’ below:

    line:1468

    // Makes carousel work on page load and when back button leads to same URL with carousel hash (ie: no actual document.ready trigger)
    	$( window ).on( 'hashchange', function () {
    		if ( 'undefined' === typeof gallery ) {
    			return;
    		}
    		var hashRegExp = /jp-carousel-(\d+)/,
    			matches, attachmentId, galleries, selectedThumbnail;
    
    		if ( ! window.location.hash || ! hashRegExp.test( window.location.hash ) ) {
    			if ( gallery.opened ) {
    				container.jp_carousel('close');
    			}
    
    			return;
    		}
    
    		if ( ( window.location.hash === last_known_location_hash ) && gallery.opened ) {
    			return;
    		}

    https://www.ads-software.com/plugins/jetpack/

Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘jetpack-carousel.js Hashtag issues’ is closed to new replies.