Ticket #4890: 4890.diff
File 4890.diff, 2.0 KB (added by , 12 years ago) |
---|
-
bp-templates/bp-legacy/buddypress-functions.php
102 102 add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS 103 103 add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization 104 104 add_action( 'bp_head', array( $this, 'head_scripts' ) ); // Output some extra JS in the <head> 105 106 /** Body no-js Class ********************************************************/ 107 add_filter( 'bp_get_the_body_class', array( $this, 'add_nojs_body_class' ) ); 105 108 106 109 /** Buttons ***********************************************************/ 107 110 … … 296 299 297 300 <?php 298 301 } 302 303 /** 304 * Adds the no-js class to the body tag. 305 * 306 * This function ensures that the <body> element will have the 'no-js' class by default. If you're 307 * using JavaScript for some visual functionality in your theme, and you want to provide noscript 308 * support, apply those styles to body.no-js. 309 * 310 * The no-js class is removed by the JavaScript created in buddypress.js. 311 * 312 * @since BuddyPress (1.7) 313 */ 314 public function add_nojs_body_class( $classes ) { 315 $classes[] = 'no-js'; 316 return array_unique( $classes ); 317 } 299 318 300 319 /** 301 320 * Load localizations for topic script -
bp-templates/bp-legacy/js/buddypress.js
1227 1227 } ); 1228 1228 }); 1229 1229 }); 1230 1231 /* if js is enabled then replace the no-js class by a js one */ 1232 if( jq('body').hasClass('no-js') ) 1233 jq('body').attr('class', jq('body').attr('class').replace( /no-js/,'js' ) ); 1234 1230 1235 }); 1231 1236 1232 1237 /* Setup activity scope and filter based on the current cookie settings. */