Skip to content

Commit

Permalink
FLUID-5093: Further improvements to "fluid.destroyValue" strategy for…
Browse files Browse the repository at this point in the history
… restarting evaluation of "components" block modified by dynamic grades
  • Loading branch information
amb26 committed Jul 18, 2013
1 parent a34968f commit c305a73
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/webapp/framework/core/js/Fluid.js
Expand Up @@ -1742,6 +1742,16 @@ var fluid = fluid || fluid_1_5;
demands: 600 // and above
};

/** Delete the value in the supplied object held at the specified path
* @param target {Object} The object holding the value to be deleted (possibly empty)
* @param path {String/Array of String} the path of the value to be deleted
*/

fluid.destroyValue = function (target, path) {
if (target) {
fluid.model.applyChangeRequest(target, {type: "DELETE", path: path});
}
};
/**
* Merges the component's declared defaults, as obtained from fluid.defaults(),
* with the user's specified overrides.
Expand Down Expand Up @@ -1789,8 +1799,9 @@ var fluid = fluid || fluid_1_5;
mergeOptions.updateBlocks = updateBlocks;
mergeOptions.destroyValue = function (path) { // This method is a temporary hack to assist FLUID-5091
for (var i = 0; i < mergeBlocks.length; ++ i) {
fluid.model.applyChangeRequest(mergeBlocks[i].target, {type: "DELETE", path: path});
fluid.destroyValue(mergeBlocks[i].target, path);
}
fluid.destroyValue(baseMergeOptions.target, path);
};

// Decode the now available mergePolicy
Expand Down

0 comments on commit c305a73

Please sign in to comment.