Last active
January 24, 2020 18:55
-
-
Save KimSarabia/61159f3fc1bd2a5674ceec70b249f151 to your computer and use it in GitHub Desktop.
Event emitter so focus goes back to modal trigger on close (MJS-4011)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample of opening the cart via componentEvents.emitEvent. | |
// NOTE: openerElement needs to be populated with an actual DOM Node | |
// or jQuery object and not just a selector. | |
// In this instance, test is the trigger element with the ID flyout-test. | |
const test = document.getElementById('flyout-test') | |
// Event emitter | |
componentEvents.emitEvent('open-cart-flyout', [{ | |
openerElement: test | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment