2 * Created by onvelocity on 3/2/16.
5 import utils
from '../../libraries/utils'
6 import DescriptorModelFactory
from '../../libraries/model/DescriptorModelFactory'
7 import CatalogItemsActions
from '../../actions/CatalogItemsActions'
8 export default function onFormInputChangedModifyContainerAndNotify(container
, event
) {
9 if (DescriptorModelFactory
.isContainer(container
)) {
10 event
.preventDefault();
11 const name
= event
.target
.name
;
12 const value
= event
.target
.value
;
13 utils
.assignPathValue(container
.model
, name
, value
);
14 CatalogItemsActions
.catalogItemDescriptorChanged(container
.getRoot());
16 throw new TypeError('onFormInputChangedModifyContainerAndNotify called without a DescriptorModel. Did you forget to bind a DescriptorModel to the event handler?');