diff options
author | Jose Antonio Marquez | 2012-02-02 18:00:45 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-02 18:00:45 -0800 |
commit | 04d89daed90c35a4393773ca2e2d0ac3a4c15cd4 (patch) | |
tree | d0041abc7379ef38b20cce148e5dea6f531b8569 /node_modules/montage/core/event/event-manager.js | |
parent | 4d8306b638c53899403a4f0328c02bf1ab893e8f (diff) | |
parent | c630ead20487c3948fa36448d3e7d5f7b5cba782 (diff) | |
download | ninja-04d89daed90c35a4393773ca2e2d0ac3a4c15cd4.tar.gz |
Merge branch 'refs/heads/NinjaInternal' into FileIO
Conflicts:
.gitignore
js/ninja.reel/ninja.js
Diffstat (limited to 'node_modules/montage/core/event/event-manager.js')
-rwxr-xr-x | node_modules/montage/core/event/event-manager.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/node_modules/montage/core/event/event-manager.js b/node_modules/montage/core/event/event-manager.js index abc441c8..4adc3926 100755 --- a/node_modules/montage/core/event/event-manager.js +++ b/node_modules/montage/core/event/event-manager.js | |||
@@ -24,6 +24,9 @@ var Montage = require("montage").Montage, | |||
24 | Deserializer = require("core/deserializer").Deserializer, | 24 | Deserializer = require("core/deserializer").Deserializer, |
25 | defaultEventManager; | 25 | defaultEventManager; |
26 | 26 | ||
27 | // XXX Does not presently function server-side | ||
28 | if (typeof window !== "undefined") { // client-side | ||
29 | |||
27 | /* This is to handle browsers that have TouchEvents but don't have the global constructor function Touch */ | 30 | /* This is to handle browsers that have TouchEvents but don't have the global constructor function Touch */ |
28 | //if(TouchEvent && typeof window.Touch === "undefined") { | 31 | //if(TouchEvent && typeof window.Touch === "undefined") { |
29 | // HACK: The commented expression fails because Chrome on the desktop also has TouchEvent and in the code we're either registering touch events OR mouse events on most components. | 32 | // HACK: The commented expression fails because Chrome on the desktop also has TouchEvent and in the code we're either registering touch events OR mouse events on most components. |
@@ -91,12 +94,12 @@ var EventListenerDescriptor = Montage.create(Montage, { | |||
91 | serializable: true, | 94 | serializable: true, |
92 | value: null | 95 | value: null |
93 | }, | 96 | }, |
94 | 97 | ||
95 | listener: { | 98 | listener: { |
96 | serializable: "reference", | 99 | serializable: "reference", |
97 | value: null | 100 | value: null |
98 | }, | 101 | }, |
99 | 102 | ||
100 | capture: { | 103 | capture: { |
101 | serializable: true, | 104 | serializable: true, |
102 | value: null | 105 | value: null |
@@ -111,19 +114,19 @@ Serializer.defineSerializationUnit("listeners", function(object) { | |||
111 | descriptor, | 114 | descriptor, |
112 | listenerDescriptor, | 115 | listenerDescriptor, |
113 | listener; | 116 | listener; |
114 | 117 | ||
115 | for (var type in eventManager.registeredEventListeners) { | 118 | for (var type in eventManager.registeredEventListeners) { |
116 | descriptors = eventManager.registeredEventListeners[type]; | 119 | descriptors = eventManager.registeredEventListeners[type]; |
117 | descriptor = descriptors && descriptors[uuid]; | 120 | descriptor = descriptors && descriptors[uuid]; |
118 | if (descriptor) { | 121 | if (descriptor) { |
119 | for (var listenerUuid in descriptor.listeners) { | 122 | for (var listenerUuid in descriptor.listeners) { |
120 | listener = descriptor.listeners[listenerUuid]; | 123 | listener = descriptor.listeners[listenerUuid]; |
121 | 124 | ||
122 | eventListenerDescriptor = EventListenerDescriptor.create(); | 125 | eventListenerDescriptor = EventListenerDescriptor.create(); |
123 | eventListenerDescriptor.type = type; | 126 | eventListenerDescriptor.type = type; |
124 | eventListenerDescriptor.listener = listener.listener; | 127 | eventListenerDescriptor.listener = listener.listener; |
125 | eventListenerDescriptor.capture = listener.capture; | 128 | eventListenerDescriptor.capture = listener.capture; |
126 | 129 | ||
127 | eventListenerDescriptors.push(eventListenerDescriptor); | 130 | eventListenerDescriptors.push(eventListenerDescriptor); |
128 | } | 131 | } |
129 | } | 132 | } |
@@ -2073,3 +2076,5 @@ if (typeof window.ondragstart !== undefined) { | |||
2073 | }; | 2076 | }; |
2074 | } | 2077 | } |
2075 | 2078 | ||
2079 | } // client-side | ||
2080 | |||