Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add widget scripts to the block editor for widgets page. #15787

Merged

Conversation

jorgefilipecosta
Copy link
Member

Description

This PR just loads the scripts/styles loaded in the widgets screen in the widget block editor page.
These artifacts were already being loaded in the post editor and they are required to make sure legacy widgets work properly.

How has this been tested?

I verified I can trigger jQuery events on the widgets page by exectuing window.$( window.document ).trigger( 'my-widget-event' );, on the console. On master this code crashes

@jorgefilipecosta jorgefilipecosta added [Priority] High Used to indicate top priority items that need quick attention [Feature] Widgets Screen The block-based screen that replaced widgets.php. labels May 22, 2019
@jorgefilipecosta jorgefilipecosta force-pushed the add/widget-scripts-to-the-widget-block-editor-page branch from fb290ea to aa0c41b Compare May 22, 2019 22:19
Copy link
Member

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and it works 👍, but I think we're inserting the script and style nodes into the wrong place.

@jorgefilipecosta jorgefilipecosta force-pushed the add/widget-scripts-to-the-widget-block-editor-page branch from aa0c41b to 3c02823 Compare May 23, 2019 12:10
@jorgefilipecosta jorgefilipecosta force-pushed the add/widget-scripts-to-the-widget-block-editor-page branch from 3c02823 to 1daffdd Compare May 23, 2019 12:13
@jorgefilipecosta
Copy link
Member Author

The code was updated, to follow the approach suggested by @noisysocks. Thank you for the review 👍

@jorgefilipecosta jorgefilipecosta merged commit 77dd41b into master May 24, 2019
@jorgefilipecosta jorgefilipecosta deleted the add/widget-scripts-to-the-widget-block-editor-page branch May 24, 2019 07:16
@youknowriad youknowriad added this to the 5.8 (Gutenberg) milestone May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Screen The block-based screen that replaced widgets.php. [Priority] High Used to indicate top priority items that need quick attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants