Changeset 58250
- Timestamp:
- 05/30/2024 02:43:30 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/updates.js
r58081 r58250 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.