fixed bug in setRenderer in Modals + updated ajax example to use Modals
This commit is contained in:
@@ -150,11 +150,11 @@
|
||||
'<div class="mailpoet_panel_body clearfix"></div>'+
|
||||
'</div>'
|
||||
},
|
||||
setRenderer: function(renderer) {
|
||||
setRenderer: function() {
|
||||
this.renderer = (typeof(Handlebars) === "undefined") ? 'html' : 'handlebars';
|
||||
},
|
||||
compileTemplate: function(template) {
|
||||
if(this.renderer = 'html') {
|
||||
if(this.renderer === 'html') {
|
||||
return function() { return template; };
|
||||
} else {
|
||||
return Handlebars.compile(template);
|
||||
|
@@ -56,9 +56,15 @@
|
||||
// Ajax
|
||||
function ajaxSuccess(data) {
|
||||
{% verbatim %}
|
||||
var template = Handlebars.compile("{{ user.name }} ({{ user.age }}) - extra value: {{ extra_value }}");
|
||||
var template = "{{ user.name }} ({{ user.age }}) - extra value: {{ extra_value }}";
|
||||
{% endverbatim %}
|
||||
$('#ajax_output').html(template(data));
|
||||
|
||||
// $('#ajax_output').html(template(data));
|
||||
MailPoet.Modal.popup({
|
||||
title: 'Ajax output',
|
||||
template: template,
|
||||
data: data
|
||||
});
|
||||
MailPoet.Modal.loading(false);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user