JAVASCRIPT   71

event.js

Guest on 3rd August 2021 11:06:03 AM

  1. var Event = function(eventType, options) {
  2.   this.type = eventType;
  3.   for (var key in options)
  4.     this[key] = options[key];
  5. };
  6.  
  7. Event.prototype.initEvent = function(eventType, canBubble, cancelable) {
  8.   this.type       = eventType;
  9.   this.bubbles    = canBubble;
  10.   this.cancelable = cancelable;
  11. };
  12.  
  13. Event.prototype.stopPropagation = function() {};
  14. Event.prototype.preventDefault  = function() {};
  15.  
  16. Event.CAPTURING_PHASE = 1;
  17. Event.AT_TARGET       = 2;
  18. Event.BUBBLING_PHASE  = 3;
  19.  
  20. module.exports = Event;

Raw Paste


Login or Register to edit or fork this paste. It's free.