wp-discourse/js/topic-map.js
2018-10-23 13:05:09 -07:00

24 lines
No EOL
762 B
JavaScript
Vendored

/* globals wpdc */
/**
* Toggles the hidden topic-map content.
*
* @package WPDiscourse
*/
(function( $ ) {
var clickTarget = 'true' === dctm.ajaxLoad ? '#wpdc-comments' : '.topic-map';
$( clickTarget ).on( 'click', "#toggle-expand", function() {
var expand_section = $( "#map-expanded" );
$( ".topic-map #arrow" ).toggleClass( 'dashicons dashicons-arrow-down-alt2 dashicons dashicons-arrow-up-alt2' );
if ( expand_section.css( "display" ) == "block" ) {
expand_section.css( 'display', 'none' );
} else {
expand_section.css( 'display', 'block' );
}
});
if ( $( '.popular-links > .popular-links-p' ).is( ':empty' ) ) {
$( '.popular-links' ).hide();
}
})( jQuery );