Changeset 58254
- Timestamp:
- 05/30/2024 04:15:18 PM (6 months ago)
- Location:
- branches/6.5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.5
-
branches/6.5/src/js/_enqueues/wp/updates.js
r58083 r58254 2665 2665 2666 2666 /** 2667 * Click handler for plugin activations in plugin activation view.2667 * Click handler for plugin activations in plugin activation modal view. 2668 2668 * 2669 2669 * @since 6.5.0 2670 * @since 6.5.4 Redirect the parent window to the activation URL. 2670 2671 * 2671 2672 * @param {Event} event Event interface. 2672 2673 */ 2673 $pluginFilter.on( 'click', '.activate-now', function( event ) { 2674 var $activateButton = $( event.target ); 2675 2674 $document.on( 'click', '#plugin-information-footer .activate-now', function( event ) { 2676 2675 event.preventDefault(); 2677 2678 if ( $activateButton.hasClass( 'activating-message' ) || $activateButton.hasClass( 'button-disabled' ) ) { 2679 return; 2680 } 2681 2682 $activateButton 2683 .removeClass( 'activate-now button-primary' ) 2684 .addClass( 'activating-message' ) 2685 .attr( 2686 'aria-label', 2687 sprintf( 2688 /* translators: %s: Plugin name. */ 2689 _x( 'Activating %s', 'plugin' ), 2690 $activateButton.data( 'name' ) 2691 ) 2692 ) 2693 .text( __( 'Activating...' ) ); 2694 2695 wp.updates.activatePlugin( 2696 { 2697 name: $activateButton.data( 'name' ), 2698 slug: $activateButton.data( 'slug' ), 2699 plugin: $activateButton.data( 'plugin' ) 2700 } 2701 ); 2676 window.parent.location.href = $( event.target ).attr( 'href' ); 2702 2677 }); 2703 2678
Note: See TracChangeset
for help on using the changeset viewer.