Skip to content

Commit

Permalink
Remove can-util as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
imaustink committed Sep 28, 2017
1 parent e0596a4 commit 63c5c90
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4,964 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
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

0 comments on commit 63c5c90

Please sign in to comment.