';
var maxItems = 2;
var porcentaje=0; //50% por defecto.
var padding=0; // false por defecto.
var fluid=0; // false por defecto.
var emptyClass;
var components = self.sectionLayoutData.components || [];
var componenttype = parseInt(self.sectionLayoutData.customSettingsData.componenttype) || 0;
if( self.sectionLayoutData.customSettingsData &&
( typeof self.sectionLayoutData.customSettingsData.maxItems === 'number' ) &&
( self.sectionLayoutData.customSettingsData.maxItems > 0 ) ) {
maxItems = self.sectionLayoutData.customSettingsData.maxItems;
}
porcentaje = parseInt(self.sectionLayoutData.customSettingsData.porcentaje) || 0;
padding = parseInt(self.sectionLayoutData.customSettingsData.padding) || 0;
fluid = parseInt(self.sectionLayoutData.customSettingsData.fluid) || 0;
if (fluid === 0){
// Update class
html = '
';
} else {
html = '
';
}
var rowClass = "row";
if (componenttype === 1 ) {
rowClass = "row align-items-center ";
if (porcentaje === 2 || porcentaje === 4){
rowClass += " flex-row-reverse ";
}
} else if (componenttype === 0 ) {
rowClass = "row align-items-center ";
} else if (componenttype === 2) {
rowClass = "row ";
} else if (componenttype === 3) {
rowClass = "row contactanos";
}
if (padding === 0){
// Remove DIV from HTML
html += '
';
} else {
html += '
';
}
try {
// Add the child components to the section layout. For each of the child
// components, add a
to the page. The child components will be
// rendered into these
s.
$.each( components, function( index, value ) {
if( !maxItems || ( index < maxItems ) ) {
html += self.createComponentDiv(value,index);
}
});
// Add a drop zone to the section layout in edit mode, if applicable
if( ( self.renderMode === SCSRenderAPI.RENDER_MODE_EDIT ) &&
( ( maxItems === 0 ) || ( components.length < maxItems ) ) ) {
emptyClass = ( components.length > 0 ) ? '' : 'sl-empty';
$(parentObj).append( '
AƱade dos elementos
' );
}
if( html ) {
$(parentObj).append( html );
}
} catch( e ) {
console.error( "Error 1909021314" );
}
},
// dynamic API for adding additional components through "load more" when used in a Content List
addComponent: function (parentObj, component) {
// create the component div and add it to the parent object
$(parentObj).append(this.createComponentDiv(component));
}
};
// Auxiliar
function buildClass(clase, componentId, responsive = false ){
if (responsive){
return '
';
} else {
return '
';
}
};
return SectionLayout;
});