Files
roi-theme/wp-content/plugins/thrive-ab-page-testing/assets/js/modals/goal.js
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 21:04:30 -06:00

34 lines
902 B
JavaScript
Executable File

module.exports = TVE_Dash.views.Modal.extend( {
initialize: function ( args ) {
if ( this.model.get( 'type' ) === 'monetary' && this.model.get( 'goal_pages' ) === 'sendowl' ) {
this.template = TVE_Dash.tpl( 'modals/goal/sendowl' );
} else {
this.template = TVE_Dash.tpl( 'modals/goal/' + this.model.get( 'type' ) );
}
TVE_Dash.views.Modal.prototype.initialize.apply( this, arguments );
},
render: function () {
TVE_Dash.views.Modal.prototype.render.apply( this, arguments );
var _tpl;
if ( this.model.get( 'type' ) === 'monetary' ) {
_tpl = TVE_Dash.tpl( 'modals/goal/revenue-row' );
} else if ( this.model.get( 'type' ) === 'visits' ) {
_tpl = TVE_Dash.tpl( 'modals/goal/page-row' );
}
if ( _tpl ) {
this.collection.each( function ( item ) {
this.$( '.thrive-ap-goal-pages' ).append( _tpl( {model: item} ) );
}, this );
}
return this;
},
} );