diff options
Diffstat (limited to 'node_modules/montage')
-rwxr-xr-x | node_modules/montage/core/event/binding.js | 24 | ||||
-rwxr-xr-x | node_modules/montage/core/serializer.js | 4 | ||||
-rwxr-xr-x | node_modules/montage/ui/application.js | 3 | ||||
-rw-r--r-- | node_modules/montage/ui/native-control.js | 2 |
4 files changed, 29 insertions, 4 deletions
diff --git a/node_modules/montage/core/event/binding.js b/node_modules/montage/core/event/binding.js index 2e226372..c10c52e4 100755 --- a/node_modules/montage/core/event/binding.js +++ b/node_modules/montage/core/event/binding.js | |||
@@ -343,9 +343,31 @@ var BindingDescriptor = exports.BindingDescriptor = Montage.create(Montage, /** | |||
343 | }); | 343 | }); |
344 | 344 | ||
345 | Serializer.defineSerializationUnit("bindings", function(object) { | 345 | Serializer.defineSerializationUnit("bindings", function(object) { |
346 | var bindingDescriptors = object._bindingDescriptors; | 346 | var bindingDescriptors = object._bindingDescriptors, |
347 | bindingDescriptorsCopy; | ||
348 | |||
349 | // TODO: Hacked this function to create copy of object literal | ||
350 | // TODO: Remove when montage finds out how to identify object literals | ||
351 | // TODO: in a different way | ||
352 | function cloneObject(object, level) { | ||
353 | var clone = {}; | ||
354 | |||
355 | for (var key in object) { | ||
356 | if (level > 0) { | ||
357 | clone[key] = cloneObject(object[key], level - 1); | ||
358 | } else { | ||
359 | clone[key] = object[key]; | ||
360 | } | ||
361 | } | ||
362 | |||
363 | return clone; | ||
364 | } | ||
347 | 365 | ||
348 | if (bindingDescriptors) { | 366 | if (bindingDescriptors) { |
367 | if (Object.getPrototypeOf(bindingDescriptors) !== Object.prototype) { | ||
368 | bindingDescriptors = cloneObject(bindingDescriptors , 1); | ||
369 | } | ||
370 | |||
349 | return bindingDescriptors; | 371 | return bindingDescriptors; |
350 | } | 372 | } |
351 | }); | 373 | }); |
diff --git a/node_modules/montage/core/serializer.js b/node_modules/montage/core/serializer.js index 72543328..deadbc68 100755 --- a/node_modules/montage/core/serializer.js +++ b/node_modules/montage/core/serializer.js | |||
@@ -529,10 +529,10 @@ var Serializer = Montage.create(Montage, /** @lends module:montage/serializer.Se | |||
529 | return this._serializeElement(value); | 529 | return this._serializeElement(value); |
530 | } else if (Array.isArray(value)) { | 530 | } else if (Array.isArray(value)) { |
531 | return this._serializeArray(value, indent + 1); | 531 | return this._serializeArray(value, indent + 1); |
532 | } else if (Object.getPrototypeOf(value) === Object.prototype) { | ||
533 | return this._serializeObjectLiteral(value, null, indent + 1); | ||
534 | } else if (value.constructor === Function) { | 532 | } else if (value.constructor === Function) { |
535 | return this._serializeFunction(value, indent); | 533 | return this._serializeFunction(value, indent); |
534 | } else if (!("getInfoForObject" in value)) { // we consider object literals the ones who aren't a Montage object | ||
535 | return this._serializeObjectLiteral(value, null, indent + 1); | ||
536 | } else { | 536 | } else { |
537 | // TODO: should refactor this to handle references here, doesn't make | 537 | // TODO: should refactor this to handle references here, doesn't make |
538 | // sense to wait until it hits _serializeObject for that to happen | 538 | // sense to wait until it hits _serializeObject for that to happen |
diff --git a/node_modules/montage/ui/application.js b/node_modules/montage/ui/application.js index bbce6835..43443ecc 100755 --- a/node_modules/montage/ui/application.js +++ b/node_modules/montage/ui/application.js | |||
@@ -153,6 +153,9 @@ var Application = exports.Application = Montage.create(Montage, /** @lends monta | |||
153 | // assign to the exports so that it is available in the deserialization of the template | 153 | // assign to the exports so that it is available in the deserialization of the template |
154 | exports.application = self; | 154 | exports.application = self; |
155 | 155 | ||
156 | ///// TODO: Remove this hack when montage exposes this | ||
157 | this._template = template; | ||
158 | |||
156 | template.instantiateWithOwnerAndDocument(null, window.document, function() { | 159 | template.instantiateWithOwnerAndDocument(null, window.document, function() { |
157 | require("ui/component").__root__.needsDraw = true; | 160 | require("ui/component").__root__.needsDraw = true; |
158 | if (callback) { | 161 | if (callback) { |
diff --git a/node_modules/montage/ui/native-control.js b/node_modules/montage/ui/native-control.js index 8dad5408..d2c7f8b1 100644 --- a/node_modules/montage/ui/native-control.js +++ b/node_modules/montage/ui/native-control.js | |||
@@ -96,7 +96,7 @@ var NativeControl = exports.NativeControl = Montage.create(Component, /** @lends | |||
96 | var newDescriptor = { | 96 | var newDescriptor = { |
97 | configurable: (typeof descriptor.configurable == 'undefined') ? true: descriptor.configurable, | 97 | configurable: (typeof descriptor.configurable == 'undefined') ? true: descriptor.configurable, |
98 | enumerable: (typeof descriptor.enumerable == 'undefined') ? true: descriptor.enumerable, | 98 | enumerable: (typeof descriptor.enumerable == 'undefined') ? true: descriptor.enumerable, |
99 | serializable: (typeof descriptor.serializable == 'undefined') ? true: descriptor.serializable, | 99 | |
100 | set: (function(name, attrName) { | 100 | set: (function(name, attrName) { |
101 | return function(value) { | 101 | return function(value) { |
102 | var desc = this._getElementAttributeDescriptor(name, this); | 102 | var desc = this._getElementAttributeDescriptor(name, this); |