Initial Drupal 11 with DDEV setup
This commit is contained in:
		
							
								
								
									
										45
									
								
								web/core/themes/claro/js/ajax.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								web/core/themes/claro/js/ajax.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,45 @@
 | 
			
		||||
/**
 | 
			
		||||
 * @file
 | 
			
		||||
 * Ajax theme overrides for Claro.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
((Drupal) => {
 | 
			
		||||
  /**
 | 
			
		||||
   * Theme override of the ajax progress indicator for full screen.
 | 
			
		||||
   *
 | 
			
		||||
   * @return {string}
 | 
			
		||||
   *   The HTML markup for the throbber.
 | 
			
		||||
   */
 | 
			
		||||
  Drupal.theme.ajaxProgressIndicatorFullscreen = () =>
 | 
			
		||||
    '<div class="ajax-progress ajax-progress--fullscreen"><div class="ajax-progress__throbber ajax-progress__throbber--fullscreen"> </div></div>';
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Theme override of the ajax progress indicator.
 | 
			
		||||
   *
 | 
			
		||||
   * @param {string} message
 | 
			
		||||
   *   The message shown on the UI.
 | 
			
		||||
   * @return {string}
 | 
			
		||||
   *   The HTML markup for the throbber.
 | 
			
		||||
   */
 | 
			
		||||
  Drupal.theme.ajaxProgressThrobber = (message) => {
 | 
			
		||||
    // Build markup without adding extra white space since it affects rendering.
 | 
			
		||||
    const messageMarkup =
 | 
			
		||||
      typeof message === 'string'
 | 
			
		||||
        ? Drupal.theme('ajaxProgressMessage', message)
 | 
			
		||||
        : '';
 | 
			
		||||
    const throbber = '<div class="ajax-progress__throbber"> </div>';
 | 
			
		||||
 | 
			
		||||
    return `<div class="ajax-progress ajax-progress--throbber">${throbber}${messageMarkup}</div>`;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Theme override of the ajax progress message.
 | 
			
		||||
   *
 | 
			
		||||
   * @param {string} message
 | 
			
		||||
   *   The message shown on the UI.
 | 
			
		||||
   * @return {string}
 | 
			
		||||
   *   The HTML markup for the throbber.
 | 
			
		||||
   */
 | 
			
		||||
  Drupal.theme.ajaxProgressMessage = (message) =>
 | 
			
		||||
    `<div class="ajax-progress__message">${message}</div>`;
 | 
			
		||||
})(Drupal);
 | 
			
		||||
		Reference in New Issue
	
	Block a user