* Factory function to wrap nestedProperty with GUI edits if necessary * with GUI edits we add an optional prefix to the nestedProperty constructor * to prepend to the attribute string in the preGUI store.
(preGUI, guiEditFlag)
| 1318 | * to prepend to the attribute string in the preGUI store. |
| 1319 | */ |
| 1320 | function makeNP(preGUI, guiEditFlag) { |
| 1321 | if (!guiEditFlag) return nestedProperty; |
| 1322 | |
| 1323 | return function (container, attr, prefix) { |
| 1324 | var np = nestedProperty(container, attr); |
| 1325 | var npSet = np.set; |
| 1326 | np.set = function (val) { |
| 1327 | var fullAttr = (prefix || '') + attr; |
| 1328 | storeCurrent(fullAttr, np.get(), val, preGUI); |
| 1329 | npSet(val); |
| 1330 | }; |
| 1331 | return np; |
| 1332 | }; |
| 1333 | } |
| 1334 | |
| 1335 | function storeCurrent(attr, val, newVal, preGUI) { |
| 1336 | if (Array.isArray(val) || Array.isArray(newVal)) { |
no test coverage detected
searching dependent graphs…