Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove can-util as dependency #9

Merged
merged 1 commit into from
Sep 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions can-event-dom-enter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var unit = require('steal-qunit');
var domEvents = require('can-dom-events');
var oldEvents = require('can-util/dom/events/events');
var definition = require('./can-event-dom-enter');
var compat = require('./compat');

Expand Down Expand Up @@ -52,24 +51,6 @@ var supportsKeyboardEvents = (function () {
}
});

// Fix oldEvent calls to match new syntax
function newifyOldEvents (oldEvents) {
return {
addEventListener: function (target) {
var args = Array.prototype.slice.call(arguments, 1);
return oldEvents.addEventListener.apply(target, args);
},
removeEventListener: function (target) {
var args = Array.prototype.slice.call(arguments, 1);
return oldEvents.removeEventListener.apply(target, args);
},
dispatch: function (target) {
var args = Array.prototype.slice.call(arguments, 1);
return oldEvents.dispatch.apply(target, args);
},
};
}

var compatWithNew = {
name: 'compat with can-dom-events',
domEvents: domEvents,
Expand All @@ -81,17 +62,6 @@ var compatWithNew = {
}
};

var compatWithOld = {
name: 'compat with can-util/dom/events',
domEvents: newifyOldEvents(oldEvents),
setup: function () {
this.removeEvent = compat(oldEvents);
},
teardown: function () {
this.removeEvent();
}
};

var rawNewDomEvents = {
name: 'plain with can-dom-events',
domEvents: domEvents,
Expand All @@ -104,7 +74,6 @@ var rawNewDomEvents = {
};

var suites = [
compatWithOld,
compatWithNew,
rawNewDomEvents
];
Expand Down
6 changes: 3 additions & 3 deletions can-event-dom-enter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var domData = require('can-util/dom/data/data');
var getCid = require("can-util/js/cid/get-cid");
var domData = require('can-dom-data-state');
var canCid = require("can-cid");

var baseEventType = 'keyup';

Expand All @@ -12,7 +12,7 @@ function isEnterEvent (event) {
}

function getHandlerKey (eventType, handler) {
return eventType + ':' + getCid(handler);
return eventType + ':' + canCid(handler);
}

function associateHandler (target, eventType, handler, otherHandler) {
Expand Down
Loading