feat(docs-infra): add getting started widgets (#26059)

PR Close #26059
This commit is contained in:
Brandon Roberts
2018-09-14 13:24:33 -05:00
committed by Kara Erickson
parent 496372dd30
commit affcbbdd7e
24 changed files with 839 additions and 1676 deletions

View File

@ -0,0 +1,16 @@
/**
* Create a `CustomEvent` (even on browsers where `CustomEvent` is not a constructor).
*/
export function createCustomEvent(doc: Document, name: string, detail: any): CustomEvent {
const bubbles = false;
const cancelable = false;
// On IE9-11, `CustomEvent` is not a constructor.
if (typeof CustomEvent !== 'function') {
const event = doc.createEvent('CustomEvent');
event.initCustomEvent(name, bubbles, cancelable, detail);
return event;
}
return new CustomEvent(name, {bubbles, cancelable, detail});
}