diff options
author | Jonathan Duran | 2012-06-20 15:04:45 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-06-20 15:04:45 -0700 |
commit | c6ae80c488621d4ac189cb63309b6258115f823a (patch) | |
tree | dfa26112e1830972fcb212bbb5b17c9a901c645f /node_modules/montage/core/event/mutable-event.js | |
parent | 022e714cb5d10cd8575ab9907eddfb184a990b66 (diff) | |
parent | c9852665eadc1acb9c1c881d207c4bd9ef88805f (diff) | |
download | ninja-c6ae80c488621d4ac189cb63309b6258115f823a.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into Timeline-merge-candidate
Diffstat (limited to 'node_modules/montage/core/event/mutable-event.js')
-rwxr-xr-x | node_modules/montage/core/event/mutable-event.js | 61 |
1 files changed, 1 insertions, 60 deletions
diff --git a/node_modules/montage/core/event/mutable-event.js b/node_modules/montage/core/event/mutable-event.js index 6f6a0cfd..2ffe2a37 100755 --- a/node_modules/montage/core/event/mutable-event.js +++ b/node_modules/montage/core/event/mutable-event.js | |||
@@ -6,18 +6,13 @@ | |||
6 | /** | 6 | /** |
7 | @module montage/core/event/mutable-event | 7 | @module montage/core/event/mutable-event |
8 | @requires montage | 8 | @requires montage |
9 | @requires montage/core/enum | ||
10 | */ | 9 | */ |
11 | var Montage = require("montage").Montage, | 10 | var Montage = require("montage").Montage; |
12 | Enum = require("core/enum").Enum; | ||
13 | 11 | ||
14 | // XXX Does not presently function server-side | 12 | // XXX Does not presently function server-side |
15 | if (typeof window !== "undefined") { | 13 | if (typeof window !== "undefined") { |
16 | 14 | ||
17 | var ChangeTypes = exports.ChangeTypes = Enum.create().initWithMembers("MODIFICATION", "ADDITION", "REMOVAL"); | ||
18 | |||
19 | var _eventConstructorsByType = {}; | 15 | var _eventConstructorsByType = {}; |
20 | var _changeEventConstructor = null; | ||
21 | var nullDescriptor = {value: null}; | 16 | var nullDescriptor = {value: null}; |
22 | 17 | ||
23 | var wrapProperty = function(obj, key) { | 18 | var wrapProperty = function(obj, key) { |
@@ -84,44 +79,6 @@ var MutableEvent = exports.MutableEvent = Montage.create(Montage,/** @lends modu | |||
84 | } | 79 | } |
85 | }, | 80 | }, |
86 | 81 | ||
87 | /** | ||
88 | @function | ||
89 | @returns new _changeEventConstructor() | ||
90 | */ | ||
91 | changeEvent: { | ||
92 | value: function() { | ||
93 | return new _changeEventConstructor(); | ||
94 | } | ||
95 | }, | ||
96 | |||
97 | /** | ||
98 | @function | ||
99 | @param {Event} key TODO | ||
100 | @param {Event} minus TODO | ||
101 | @returns changeEvent | ||
102 | */ | ||
103 | changeEventForKeyAndValue: { | ||
104 | value: function(key, minus) { | ||
105 | var changeEvent = new _changeEventConstructor(); | ||
106 | changeEvent.type = "change@" + key; | ||
107 | changeEvent.minus = minus; | ||
108 | changeEvent.plus = undefined; | ||
109 | changeEvent.propertyChange = ChangeTypes.MODIFICATION; | ||
110 | return changeEvent; | ||
111 | } | ||
112 | }, | ||
113 | |||
114 | /** | ||
115 | @function | ||
116 | @param {String} plus TODO | ||
117 | @returns itself | ||
118 | */ | ||
119 | withPlusValue: { | ||
120 | value: function(plus) { | ||
121 | this.plus = plus; | ||
122 | return this; | ||
123 | } | ||
124 | }, | ||
125 | /** | 82 | /** |
126 | @private | 83 | @private |
127 | */ | 84 | */ |
@@ -220,21 +177,5 @@ var MutableEvent = exports.MutableEvent = Montage.create(Montage,/** @lends modu | |||
220 | } | 177 | } |
221 | 178 | ||
222 | }); | 179 | }); |
223 | /** | ||
224 | @private | ||
225 | */ | ||
226 | _changeEventConstructor = function() { | ||
227 | }; | ||
228 | /** | ||
229 | @private | ||
230 | */ | ||
231 | _changeEventConstructor.prototype = MutableEvent.create()._initPrototypeWithEvent(document.createEvent("CustomEvent").initCustomEvent("change", true, false, null)); | ||
232 | // TODO this shouldn't be necessary; initWithCustomEvent should be setting the type to "change" but that doesn't seem to be the case | ||
233 | // TODO should file a bug on this with some test reduction | ||
234 | /** | ||
235 | @private | ||
236 | */ | ||
237 | _changeEventConstructor.prototype.type = "change"; | ||
238 | exports._Change = _changeEventConstructor; | ||
239 | 180 | ||
240 | } // client-side | 181 | } // client-side |