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