Skip to content

Commit

Permalink
Revert "Use gracezlive's solution to SteveSanderson#199 instead. Merg…
Browse files Browse the repository at this point in the history
…e branch 'master' of https://github.com/gracezlive/knockout.mapping"

This reverts commit f94044d, reversing
changes made to 9c5dd63.
  • Loading branch information
Andre Gregori authored and Andre Gregori committed Feb 17, 2016
1 parent f94044d commit f127ed9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions knockout.mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,16 +447,16 @@
visitPropertiesOrArrayEntries(rootObject, function (indexer) {
var fullPropertyName = parentPropertyName.length ? parentPropertyName + "." + indexer : indexer;

if (ko.utils.arrayIndexOf(options.ignore, indexer) != -1) {
if (ko.utils.arrayIndexOf(options.ignore, fullPropertyName) != -1) {
return;
}

if (ko.utils.arrayIndexOf(options.copy, indexer) != -1) {
if (ko.utils.arrayIndexOf(options.copy, fullPropertyName) != -1) {
mappedRootObject[indexer] = rootObject[indexer];
return;
}

if(typeof rootObject[indexer] != "object" && typeof rootObject[indexer] != "array" && options.observe.length > 0 && ko.utils.arrayIndexOf(options.observe, indexer) == -1)
if(typeof rootObject[indexer] != "object" && typeof rootObject[indexer] != "array" && options.observe.length > 0 && ko.utils.arrayIndexOf(options.observe, fullPropertyName) == -1)
{
mappedRootObject[indexer] = rootObject[indexer];
options.copiedProperties[fullPropertyName] = true;
Expand All @@ -469,7 +469,7 @@
var retval = updateViewModel(mappedRootObject[indexer], rootObject[indexer], options, indexer, mappedRootObject, fullPropertyName, mappedRootObject);
var value = prevMappedProperty || retval;

if(options.observe.length > 0 && ko.utils.arrayIndexOf(options.observe, indexer) == -1)
if(options.observe.length > 0 && ko.utils.arrayIndexOf(options.observe, fullPropertyName) == -1)
{
mappedRootObject[indexer] = ko.utils.unwrapObservable(value);
options.copiedProperties[fullPropertyName] = true;
Expand Down

0 comments on commit f127ed9

Please sign in to comment.