You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
912 B

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. var getNamedInputValues = function ($scope) {
  2. return filter($scope.inputVal(), function (val, key) {
  3. return key !== 'undefined';
  4. });
  5. };
  6. var generateNameMappedInputValues = function (group, index, defaultValue, override) {
  7. var defaultObject = {};
  8. defaultObject['group-' + group + '[' + index + '][text-input]'] = defaultValue;
  9. defaultObject['group-' + group + '[' + index + '][textarea-input]'] = defaultValue;
  10. defaultObject['group-' + group + '[' + index + '][select-input]'] = defaultValue || null;
  11. defaultObject['group-' + group + '[' + index + '][radio-input]'] = defaultValue || null;
  12. defaultObject['group-' + group + '[' + index + '][checkbox-input][]'] = defaultValue ? [defaultValue] : [];
  13. defaultObject['group-' + group + '[' + index + '][multiple-select-input][]'] = defaultValue ? [defaultValue] : [];
  14. return $.extend(defaultObject, override || {});
  15. };