Skip to content

Commit

Permalink
Merge pull request #259 from stephencattaneo/no-jquery-event
Browse files Browse the repository at this point in the history
Expect native events instead of jQuery wrapped events
  • Loading branch information
jgwhite authored Jun 11, 2019
2 parents 6952392 + 9605199 commit 38d5a9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions addon/mixins/sortable-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,7 @@ export default Mixin.create({
@private
*/
function getY(event) {
let originalEvent = event.originalEvent;
let touches = originalEvent? originalEvent.changedTouches : event.changedTouches;
let touches = event.changedTouches;
let touch = touches && touches[0];

if (touch) {
Expand All @@ -720,8 +719,7 @@ function getY(event) {
@private
*/
function getX(event) {
let originalEvent = event.originalEvent;
let touches = originalEvent? originalEvent.changedTouches : event.changedTouches;
let touches = event.changedTouches;
let touch = touches && touches[0];

if (touch) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/components/sortable-item-mixin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { run } from '@ember/runloop';
import { moduleForComponent, test } from 'ember-qunit';
import $ from 'jquery';

const MockEvent = { originalEvent: null };
const MockEvent = { };
const MockModel = { name: 'Mock Model' };
const MockGroup = EmberObject.extend({
direction: 'y',
Expand Down

0 comments on commit 38d5a9b

Please sign in to comment.