app/options_custom/settings.js
// Used to map out the belongsTo ids from the keys passed in
Used to map out the belongsTo ids from the keys passed in
Used to map out the belongsTo ids from the keys passed in
function mapIds(array, pluralKey, singularKey) {
                var results = []
                jQuery.each(array, function(_, item){
                  if(jQuery.isArray(item[pluralKey])) {
                    jQuery.each(item[pluralKey], function(_, entity) {
                      results.push(Number(entity[singularKey+'_id']));
                    });
                  } else if(item[pluralKey] && pluralKey == 'projects') {
                    jQuery.each(item[pluralKey].split(/\s+/), function(_, id) {
                      results.push(Number(id));
                    });
                  }
                });
                return results;
              }
function mapIds ( array , pluralKey , singularKey ) { var results = [ ] jQuery . each ( array , function ( _ , item ) { if ( jQuery . isArray ( item [ pluralKey ] ) ) { jQuery . each ( item [ pluralKey ] , function ( _ , entity ) { results . push ( Number ( entity [ singularKey + '_id' ] ) ) ; } ) ; } else if ( item [ pluralKey ] && pluralKey == 'projects' ) { jQuery . each ( item [ pluralKey ] . split ( / \s+ / ) , function ( _ , id ) { results . push ( Number ( id ) ) ; } ) ; } } ) ; return results ; }
Used to map out the belongsTo ids from the keys passed in
Used to map out the belongsTo ids from the keys passed in