Skip to content

Commit

Permalink
Remove jQueryEventShim from link-to
Browse files Browse the repository at this point in the history
  • Loading branch information
simonihmig committed Jul 22, 2021
1 parent 339670e commit 0d935ae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
24 changes: 0 additions & 24 deletions packages/@ember/-internals/glimmer/lib/components/internal.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Owner, setOwner } from '@ember/-internals/owner';
import { guidFor } from '@ember/-internals/utils';
import { jQuery, jQueryDisabled } from '@ember/-internals/views';
import { EMBER_MODERNIZED_BUILT_IN_COMPONENTS } from '@ember/canary-features';
import { assert, deprecate } from '@ember/debug';
import { JQUERY_INTEGRATION } from '@ember/deprecated-features';
import {
CapturedArguments,
Destroyable,
Expand Down Expand Up @@ -552,25 +550,3 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
});
};
}

export function jQueryEventShim(target: DeprecatingInternalComponentConstructor): void {
if (JQUERY_INTEGRATION) {
let { prototype } = target;

let superListenerFor = prototype['listenerFor'];

Object.defineProperty(prototype, 'listenerFor', {
configurable: true,
enumerable: false,
value: function listenerFor(this: InternalComponent, name: string): EventListener {
let listener = superListenerFor.call(this, name);

if (jQuery && !jQueryDisabled) {
return (event: Event) => listener(new jQuery.Event(event));
} else {
return listener;
}
},
});
}
}
6 changes: 0 additions & 6 deletions packages/@ember/-internals/glimmer/lib/components/link-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { TargetActionSupport } from '@ember/-internals/runtime';
import { isSimpleClick } from '@ember/-internals/views';
import { EMBER_MODERNIZED_BUILT_IN_COMPONENTS } from '@ember/canary-features';
import { assert, debugFreeze, deprecate, warn } from '@ember/debug';
import { JQUERY_INTEGRATION } from '@ember/deprecated-features';
import { EngineInstance, getEngineParent } from '@ember/engine';
import { flaggedInstrument } from '@ember/instrumentation';
import { action } from '@ember/object';
Expand All @@ -22,7 +21,6 @@ import InternalComponent, {
handleDeprecatedArguments,
handleDeprecatedAttributeArguments,
handleDeprecatedEventArguments,
jQueryEventShim,
opaquify,
} from './internal';

Expand Down Expand Up @@ -710,8 +708,4 @@ if (EMBER_MODERNIZED_BUILT_IN_COMPONENTS) {
}
}

if (JQUERY_INTEGRATION) {
jQueryEventShim(LinkTo);
}

export default opaquify(LinkTo, LinkToTemplate);

0 comments on commit 0d935ae

Please sign in to comment.