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

Simplify hooking to Accessibility Checker loaded event #246

Open
mlewand opened this issue Mar 27, 2018 · 0 comments
Open

Simplify hooking to Accessibility Checker loaded event #246

mlewand opened this issue Mar 27, 2018 · 0 comments

Comments

@mlewand
Copy link
Contributor

mlewand commented Mar 27, 2018

Currently there's this inconvenient way to listen for AC readiness, where it could be loaded either:

  • synchronously - for released packages
  • asynchronously - for dev version

Reason for this is that the dev version uses Require.js for all the deps - which are inlined on release version to get rid of Require.js dependency.

Because of that often our snippets use code like:

var a11ychecker = editor._.a11ychecker;

if ( a11ychecker.exec ) {
	a11yCheckerReady( editor )
} else {
	a11ychecker.once( 'loaded', function() {
		a11yCheckerReady( editor );
	} );
}

To detect whether AC is fully functional yet.

The problem is with this logic fork, what we want to do here is to always have the same way to interact with AC. It's ok if it requires hooking asynchronously, like a11ychecker.once( 'loaded', function() { … }) as long as it does not require this awful if fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant