[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/admin/js/ -> types-admin.js (source)

   1  ( function() {
   2      var bpTypesCustomizeForm = function() {
   3          if ( document.querySelector( '#addtag input[name="post_type"]' ) ) {
   4              document.querySelector( '#addtag input[name="post_type"]' ).remove();
   5          }
   6  
   7          if ( document.querySelectorAll( '.form-field' ) ) {
   8              document.querySelectorAll( '.form-field' ).forEach( function( element ) {
   9                  if ( -1 === element.classList.value.indexOf( 'bp-types-form' ) ) {
  10                      element.remove();
  11                  }
  12              } );
  13          }
  14  
  15          if ( document.querySelector( '#bp_type_has_directory' ) ) {
  16              if ( true === document.querySelector( '#bp_type_has_directory' ).checked ) {
  17                  document.querySelector( '.term-bp_type_directory_slug-wrap' ).classList.add( 'bp-set-directory-slug' );
  18              }
  19  
  20              document.querySelector( '#bp_type_has_directory' ).addEventListener( 'change', function( event ) {
  21                  if ( true === event.target.checked ) {
  22                      document.querySelector( '.term-bp_type_directory_slug-wrap' ).classList.add( 'bp-set-directory-slug' );
  23                      document.querySelector( '#bp_type_directory_slug' ).removeAttribute( 'disabled' );
  24                  } else {
  25                      document.querySelector( '.term-bp_type_directory_slug-wrap' ).classList.remove( 'bp-set-directory-slug' );
  26                      document.querySelector( '#bp_type_directory_slug' ).setAttribute( 'disabled', 'disabled' );
  27                  }
  28              } );
  29          }
  30  
  31          if ( document.querySelector( '#delete-link' ) ) {
  32              document.querySelector( '#delete-link' ).remove();
  33          }
  34      };
  35  
  36      if ( 'loading' === document.readyState ) {
  37          document.addEventListener( 'DOMContentLoaded', bpTypesCustomizeForm );
  38      } else {
  39          bpTypesCustomizeForm;
  40      }
  41  } )();


Generated: Fri Feb 26 01:01:36 2021 Cross-referenced by PHPXref 0.7.1