paper.js/src/ui/Event.js

51 lines
909 B
JavaScript
Raw Normal View History

/*
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
2014-01-03 19:47:16 -05:00
* Copyright (c) 2011 - 2014, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
2011-07-01 06:17:45 -04:00
* Distributed under the MIT license. See LICENSE file for details.
*
* All rights reserved.
*/
/**
* @name Event
* @class
*/
var Event = Base.extend(/** @lends Event# */{
_class: 'Event',
initialize: function Event(event) {
this.event = event;
},
isPrevented: false,
isStopped: false,
preventDefault: function() {
this.isPrevented = true;
this.event.preventDefault();
},
stopPropagation: function() {
this.isStopped = true;
this.event.stopPropagation();
},
stop: function() {
this.stopPropagation();
this.preventDefault();
},
// DOCS: Document Event#modifiers
/**
* @type object
* @bean
*/
2011-05-08 10:50:17 -04:00
getModifiers: function() {
return Key.modifiers;
}
});