# var url = ''; var selectName = ''; if ( data.isMultiple ) { if ( data.settings[ data.rootName + '_src' ] ) { url = data.settings[ data.rootName + '_src' ][ data.index ]; } selectName = data.rootName + '_src[]'; } else { url = data.settings[ data.name + '_src' ]; selectName = data.name + '_src'; } var photo = null; if ( FLBuilderSettingsConfig.attachments[ data.value ] ) { photo = FLBuilderSettingsConfig.attachments[ data.value ]; photo.isAttachment = true; } else if ( ! _.isEmpty( data.value ) ) { if ( data.settings[ data.rootName + '_src' ] ) { photo = { id: data.value, url: url, filename: url.split( '/' ).pop(), isAttachment: false }; } else { photo = { id: 0, url: data.value, filename: data.value.split( '/' ).pop(), isAttachment: false }; } } var field = data.field; var className = 'fl-photo-field fl-builder-custom-field'; if ( ! data.value || ! photo ) { className += ' fl-photo-empty'; } else if ( photo ) { className += photo.isAttachment ? ' fl-photo-has-attachment' : ' fl-photo-no-attachment'; } if ( field.className ) { className += ' ' + field.className; } var show = ''; if ( field.show ) { show = "data-show='" + JSON.stringify( field.show ) + "'"; } #>