Changeset 8494
- Timestamp:
- 06/10/2014 12:51:44 PM (11 years ago)
- Location:
- trunk/src/bp-xprofile
- Files:
-
- 2 edited
-
admin/js/admin.js (modified) (1 diff)
-
bp-xprofile-cssjs.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/admin/js/admin.js
r8378 r8494 62 62 } 63 63 64 function show_options(forWhat) { 65 document.getElementById( 'radio' ).style.display = 'none'; 66 document.getElementById( 'selectbox' ).style.display = 'none'; 67 document.getElementById( 'multiselectbox' ).style.display = 'none'; 68 document.getElementById( 'checkbox' ).style.display = 'none'; 69 70 if ( forWhat === 'radio' ) { 71 document.getElementById( 'radio' ).style.display = ''; 72 } 73 74 if ( forWhat === 'selectbox' ) { 75 document.getElementById( 'selectbox' ).style.display = ''; 76 } 77 78 if ( forWhat === 'multiselectbox' ) { 79 document.getElementById( 'multiselectbox' ).style.display = ''; 80 } 81 82 if ( forWhat === 'checkbox' ) { 83 document.getElementById( 'checkbox' ).style.display = ''; 64 /** 65 * Hide all "options" sections, and show the options section for the forWhat type. 66 */ 67 function show_options( forWhat ) { 68 for ( var i = 0; i < XProfileAdmin.supports_options_field_types.length; i++ ) { 69 document.getElementById( XProfileAdmin.supports_options_field_types[i] ).style.display = 'none'; 70 } 71 72 if ( XProfileAdmin.supports_options_field_types.indexOf( forWhat ) >= 0 ) { 73 document.getElementById( forWhat ).style.display = ''; 84 74 } 85 75 } -
trunk/src/bp-xprofile/bp-xprofile-cssjs.php
r7756 r8494 40 40 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 41 41 wp_enqueue_script( 'xprofile-admin-js', buddypress()->plugin_url . "bp-xprofile/admin/js/admin{$min}.js", array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); 42 43 // Localize strings. 44 // supports_options_field_types is a dynamic list of field 45 // types that support options, for use in showing/hiding the 46 // "please enter options for this field" section 47 $strings = array( 48 'supports_options_field_types' => array(), 49 ); 50 51 foreach ( bp_xprofile_get_field_types() as $field_type => $field_type_class ) { 52 $field = new $field_type_class(); 53 if ( $field->supports_options ) { 54 $strings['supports_options_field_types'][] = $field_type; 55 } 56 } 57 58 wp_localize_script( 'xprofile-admin-js', 'XProfileAdmin', $strings ); 42 59 } 43 60 }
Note: See TracChangeset
for help on using the changeset viewer.