WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#38461 closed enhancement (invalid)

Don't load svg-painter.js on every admin screen

Reported by: johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8
Component: Administration Keywords: has-patch close
Focuses: administration, performance Cc:

Description

svg-painter.js gets loaded on every admin screen, but only user-profile.js uses it (on the user profile editing screen).

Attachments (1)

38461.patch (1.2 KB) - added by johnbillion 4 years ago.

Download all attachments as: .zip

Change History (5)

@johnbillion
4 years ago

#1 @johnbillion
4 years ago

  • Keywords has-patch added

#2 @ocean90
4 years ago

  • Keywords close added

Isn't user-profile.js just re-initializing the painter on color scheme changes?

Otherwise the script is always initializing itself if the current browser doesn't support SVG:

	$(document).ready( function() {
		// detection for browser SVG capability
		if ( document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) {
			$( document.body ).removeClass( 'no-svg' ).addClass( 'svg' );
			wp.svgPainter.init();
		}
	});

#3 @afercia
4 years ago

I think it is needed also for plugins that use SVG icons, to change the icon color on :hover (as far as I know it never worked on :focus). An example is an admin menu item with a SVG icon.

#4 @johnbillion
4 years ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.