2011-05-08 13:43:52 +01:00
|
|
|
/*
|
2013-01-28 18:03:27 -08:00
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
2011-05-08 13:43:52 +01:00
|
|
|
* http://paperjs.org/
|
2011-06-30 06:01:51 -04:00
|
|
|
*
|
2014-01-04 01:47:16 +01:00
|
|
|
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
|
|
|
|
* http://scratchdisk.com/ & http://jonathanpuckey.com/
|
2011-06-30 06:01:51 -04:00
|
|
|
*
|
2011-07-01 12:17:45 +02:00
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
2011-05-08 13:43:52 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2011-06-22 23:56:05 +01:00
|
|
|
/**
|
|
|
|
* @name Event
|
|
|
|
* @class
|
|
|
|
*/
|
2013-05-27 12:48:58 -07:00
|
|
|
var Event = Base.extend(/** @lends Event# */{
|
2013-06-23 20:18:32 -07:00
|
|
|
_class: 'Event',
|
|
|
|
|
2013-05-27 12:48:58 -07:00
|
|
|
initialize: function Event(event) {
|
2011-05-08 13:43:52 +01:00
|
|
|
this.event = event;
|
|
|
|
},
|
|
|
|
|
2013-12-06 21:49:44 +01:00
|
|
|
isPrevented: false,
|
|
|
|
isStopped: false,
|
|
|
|
|
2011-05-08 13:43:52 +01:00
|
|
|
preventDefault: function() {
|
2013-12-06 21:49:44 +01:00
|
|
|
this.isPrevented = true;
|
|
|
|
this.event.preventDefault();
|
2011-05-08 13:43:52 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
stopPropagation: function() {
|
2013-12-06 21:49:44 +01:00
|
|
|
this.isStopped = true;
|
|
|
|
this.event.stopPropagation();
|
2011-05-08 13:43:52 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
stop: function() {
|
2013-03-05 20:39:07 -08:00
|
|
|
this.stopPropagation();
|
|
|
|
this.preventDefault();
|
2011-05-08 13:43:52 +01:00
|
|
|
},
|
|
|
|
|
2011-06-16 21:20:30 +01:00
|
|
|
// DOCS: Document Event#modifiers
|
|
|
|
/**
|
|
|
|
* @type object
|
|
|
|
* @bean
|
|
|
|
*/
|
2011-05-08 15:50:17 +01:00
|
|
|
getModifiers: function() {
|
|
|
|
return Key.modifiers;
|
2011-05-08 13:43:52 +01:00
|
|
|
}
|
|
|
|
});
|