'use strict';
'browser-only';

/**
 * @license
 * (c) 2014 Cluster Labs, Inc. https://cluster.co/
 * License: MIT
 */

var ElementWrapper = skit.browser.ElementWrapper;


var Event = function(evt) {
  this.evt_ = evt;

  this.target = new ElementWrapper(evt.srcElement || evt.target);
  this.currentTarget = null;

  this.type = evt.type;

  this.keyCode = evt.keyCode || null;
  this.shiftKey = evt.shiftKey || false;

  // mouseX, mouseY, keyCode, etc.
};


Event.prototype.stopPropagation = function() {
  if (this.evt_.stopPropagation) {
    this.evt_.stopPropagation();
  } else {
    this.evt_.cancelBubble = true;
  }
};


Event.prototype.preventDefault = function() {
  if (this.evt_.preventDefault) {
    this.evt_.preventDefault();
  } else {
    this.evt_.returnValue = false;
  }
};


return Event;

'use strict';
'browser-only';

/**
 * @license
 * (c) 2014 Cluster Labs, Inc. https://cluster.co/
 * License: MIT
 */

var ElementWrapper = skit.browser.ElementWrapper;


var Event = function(evt) {
  this.evt_ = evt;

  this.target = new ElementWrapper(evt.srcElement || evt.target);
  this.currentTarget = null;

  this.type = evt.type;

  this.keyCode = evt.keyCode || null;
  this.shiftKey = evt.shiftKey || false;

  var posX = 0;
  var posY = 0;
  if (evt.pageX || evt.pageY)   {
    posX = evt.pageX;
    posY = evt.pageY;
  } else if (evt.clientX || evt.clientY)  {
    posX = evt.clientX + document.body.scrollLeft
      + document.documentElement.scrollLeft;
    posY = evt.clientY + document.body.scrollTop
      + document.documentElement.scrollTop;
  }

  this.pageX = posX;
  this.pageY = posY;
};


Event.prototype.stopPropagation = function() {
  if (this.evt_.stopPropagation) {
    this.evt_.stopPropagation();
  } else {
    this.evt_.cancelBubble = true;
  }
};


Event.prototype.preventDefault = function() {
  if (this.evt_.preventDefault) {
    this.evt_.preventDefault();
  } else {
    this.evt_.returnValue = false;
  }
};


return Event;

Set pageX/pageY according to quirksmode's rules.
Set pageX/pageY according to quirksmode's rules.
