1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var dependents_1 = require("../dependents");
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | var Event = (function () {
|
9 | function Event(view, gEvent, data) {
|
10 | this.view = view;
|
11 | this.gEvent = gEvent;
|
12 | this.data = data;
|
13 | this.type = gEvent.type;
|
14 | }
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | Event.fromData = function (view, type, data) {
|
22 | return new Event(view, new dependents_1.Event(type, {}), data);
|
23 | };
|
24 | Object.defineProperty(Event.prototype, "target", {
|
25 |
|
26 |
|
27 | get: function () {
|
28 |
|
29 |
|
30 | return this.gEvent.target;
|
31 | },
|
32 | enumerable: false,
|
33 | configurable: true
|
34 | });
|
35 | Object.defineProperty(Event.prototype, "event", {
|
36 |
|
37 | get: function () {
|
38 | return this.gEvent.originalEvent;
|
39 | },
|
40 | enumerable: false,
|
41 | configurable: true
|
42 | });
|
43 | Object.defineProperty(Event.prototype, "x", {
|
44 |
|
45 | get: function () {
|
46 | return this.gEvent.x;
|
47 | },
|
48 | enumerable: false,
|
49 | configurable: true
|
50 | });
|
51 | Object.defineProperty(Event.prototype, "y", {
|
52 |
|
53 | get: function () {
|
54 | return this.gEvent.y;
|
55 | },
|
56 | enumerable: false,
|
57 | configurable: true
|
58 | });
|
59 | Object.defineProperty(Event.prototype, "clientX", {
|
60 |
|
61 | get: function () {
|
62 | return this.gEvent.clientX;
|
63 | },
|
64 | enumerable: false,
|
65 | configurable: true
|
66 | });
|
67 | Object.defineProperty(Event.prototype, "clientY", {
|
68 |
|
69 | get: function () {
|
70 | return this.gEvent.clientY;
|
71 | },
|
72 | enumerable: false,
|
73 | configurable: true
|
74 | });
|
75 |
|
76 | |
77 |
|
78 |
|
79 |
|
80 | Event.prototype.toString = function () {
|
81 | return "[Event (type=".concat(this.type, ")]");
|
82 | };
|
83 | |
84 |
|
85 |
|
86 |
|
87 | Event.prototype.clone = function () {
|
88 | return new Event(this.view, this.gEvent, this.data);
|
89 | };
|
90 | return Event;
|
91 | }());
|
92 | exports.default = Event;
|
93 |
|
\ | No newline at end of file |