Ticket #4890: 4890-improved.diff
File 4890-improved.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( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); 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 if( !in_array( 'no-js', $classes) ) 316 $classes[] = 'no-js'; 317 318 return array_unique( $classes ); 319 } 299 320 300 321 /** 301 322 * 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. */