pull/4527/head
hontas 6 years ago
parent 7d9ff14099
commit 0245239eaa

@ -273,9 +273,6 @@ export function toggle_class(element, name, toggle) {
}
export function custom_event<T=any>(type: string, detail?: T) {
// is compile target customElement?
// is event not a Svelte event?
// use new CustomEvent with bubbles/composed = true for non, svelte event
const e: CustomEvent<T> = document.createEvent('CustomEvent');
e.initCustomEvent(type, false, false, detail);
return e;
@ -319,4 +316,4 @@ export class HtmlTag {
d() {
this.n.forEach(detach);
}
}
}

@ -28,8 +28,6 @@ export function onDestroy(fn) {
}
export function createEventDispatcher() {
// is compile target customElement?
// always dispatch!
const component = get_current_component();
return (type: string, detail?: any) => {
@ -63,4 +61,4 @@ export function bubble(component, event) {
if (callbacks) {
callbacks.slice().forEach(fn => fn(event));
}
}
}
Loading…
Cancel
Save