Permalink
Browse files

Reverting changes by DzenisevichK until issues are solved

  • Loading branch information...
1 parent 0c0cd96 commit 42262db1d59302932369cca758606045d38f6ccd @RoyJacobs RoyJacobs committed Jun 6, 2012
View
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Knockout.Mapping</id>
- <version>2.1.0</version>
+ <version>2.1.3</version>
<authors>Roy Jacobs</authors>
<licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
<projectUrl>http://knockoutjs.com/documentation/plugins-mapping.html</projectUrl>
@@ -1,5 +1,5 @@
-// Knockout Mapping plugin v2.1.0
-// (c) 2011 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/
+// Knockout Mapping plugin v2.1.3
+// (c) 2012 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
(function (factory) {
@@ -16,6 +16,7 @@
factory(ko, ko.mapping = {});
}
}(function (ko, exports) {
+ var DEBUG=true;
var mappingProperty = "__ko_mapping__";
var realKoDependentObservable = ko.dependentObservable;
var mappingNesting = 0;
@@ -97,9 +98,10 @@
// it will be done by this code.
if (!--mappingNesting) {
window.setTimeout(function () {
- ko.utils.arrayForEach(dependentObservables, function (DO) {
+ while (dependentObservables.length) {
+ var DO = dependentObservables.pop();
if (DO) DO();
- });
+ }
}, 0);
}
@@ -208,12 +210,12 @@
ko.dependentObservable = function (read, owner, options) {
options = options || {};
- var realDeferEvaluation = options.deferEvaluation;
-
if (read && typeof read == "object") { // mirrors condition in knockout implementation of DO's
options = read;
}
+ var realDeferEvaluation = options.deferEvaluation;
+
var isRemoved = false;
// We wrap the original dependent observable so that we can remove it from the 'dependentObservables' list we need to evaluate after mapping has
@@ -231,22 +233,22 @@
return DO(val);
},
deferEvaluation: true
- });
- wrapped.__ko_proto__ = realKoDependentObservable;
+ });
+ if(DEBUG) wrapped._wrapper = true;
return wrapped;
};
options.deferEvaluation = true; // will either set for just options, or both read/options.
var realDependentObservable = new realKoDependentObservable(read, owner, options);
- realDependentObservable.__ko_proto__ = realKoDependentObservable;
if (!realDeferEvaluation) {
- dependentObservables.push(realDependentObservable);
realDependentObservable = wrap(realDependentObservable);
+ dependentObservables.push(realDependentObservable);
}
return realDependentObservable;
}
+ ko.dependentObservable.fn = realKoDependentObservable.fn;
ko.computed = ko.dependentObservable;
var result = callback();
ko.dependentObservable = localDO;

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-// Knockout Mapping plugin v2.1.0
-// (c) 2011 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/
+// Knockout Mapping plugin v2.1.3
+// (c) 2012 Steven Sanderson, Roy Jacobs - http://knockoutjs.com/
// License: MIT (http://www.opensource.org/licenses/mit-license.php)

0 comments on commit 42262db

Please sign in to comment.