driver-browser
Advanced tools
Comparing version 0.4.14 to 0.5.0-beta
@@ -28,2 +28,5 @@ 'use strict'; | ||
var ADD_EVENT = 'addEvent'; | ||
var REMOVE_EVENT = 'removeEvent'; | ||
var Driver = { | ||
@@ -33,2 +36,3 @@ | ||
viewportWidth: typeof VIEWPORT_WIDTH !== 'undefined' && VIEWPORT_WIDTH || 750, | ||
eventRegistry: {}, | ||
@@ -101,7 +105,15 @@ getDeviceWidth: function getDeviceWidth() { | ||
}, | ||
addEventListener: function addEventListener(node, eventName, eventHandler) { | ||
return node.addEventListener(eventName, eventHandler); | ||
addEventListener: function addEventListener(node, eventName, eventHandler, props) { | ||
if (this.eventRegistry[eventName]) { | ||
return this.eventRegistry[eventName](ADD_EVENT, node, eventName, eventHandler, props); | ||
} else { | ||
return node.addEventListener(eventName, eventHandler); | ||
} | ||
}, | ||
removeEventListener: function removeEventListener(node, eventName, eventHandler) { | ||
return node.removeEventListener(eventName, eventHandler); | ||
removeEventListener: function removeEventListener(node, eventName, eventHandler, props) { | ||
if (this.eventRegistry[eventName]) { | ||
return this.eventRegistry[eventName](REMOVE_EVENT, node, eventName, eventHandler, props); | ||
} else { | ||
return node.removeEventListener(eventName, eventHandler); | ||
} | ||
}, | ||
@@ -108,0 +120,0 @@ removeAllEventListeners: function removeAllEventListeners(node) { |
{ | ||
"name": "driver-browser", | ||
"version": "0.4.14", | ||
"version": "0.5.0-beta", | ||
"description": "Browser driver for Rax", | ||
@@ -16,4 +16,4 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"style-unit": "^0.4.14" | ||
"style-unit": "^0.5.0-beta" | ||
} | ||
} |
@@ -17,2 +17,5 @@ /** | ||
const ADD_EVENT = 'addEvent'; | ||
const REMOVE_EVENT = 'removeEvent'; | ||
const Driver = { | ||
@@ -22,2 +25,3 @@ | ||
viewportWidth: typeof VIEWPORT_WIDTH !== 'undefined' && VIEWPORT_WIDTH || 750, | ||
eventRegistry: {}, | ||
@@ -106,8 +110,16 @@ getDeviceWidth() { | ||
addEventListener(node, eventName, eventHandler) { | ||
return node.addEventListener(eventName, eventHandler); | ||
addEventListener(node, eventName, eventHandler, props) { | ||
if (this.eventRegistry[eventName]) { | ||
return this.eventRegistry[eventName](ADD_EVENT, node, eventName, eventHandler, props); | ||
} else { | ||
return node.addEventListener(eventName, eventHandler); | ||
} | ||
}, | ||
removeEventListener(node, eventName, eventHandler) { | ||
return node.removeEventListener(eventName, eventHandler); | ||
removeEventListener(node, eventName, eventHandler, props) { | ||
if (this.eventRegistry[eventName]) { | ||
return this.eventRegistry[eventName](REMOVE_EVENT, node, eventName, eventHandler, props); | ||
} else { | ||
return node.removeEventListener(eventName, eventHandler); | ||
} | ||
}, | ||
@@ -114,0 +126,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17501
557
+ Addedstyle-unit@0.5.4(transitive)
- Removedstyle-unit@0.4.20(transitive)
Updatedstyle-unit@^0.5.0-beta