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 class="mailpoet_panel_body clearfix"></div>'+
|
||||||
'</div>'
|
'</div>'
|
||||||
},
|
},
|
||||||
setRenderer: function(renderer) {
|
setRenderer: function() {
|
||||||
this.renderer = (typeof(Handlebars) === "undefined") ? 'html' : 'handlebars';
|
this.renderer = (typeof(Handlebars) === "undefined") ? 'html' : 'handlebars';
|
||||||
},
|
},
|
||||||
compileTemplate: function(template) {
|
compileTemplate: function(template) {
|
||||||
if(this.renderer = 'html') {
|
if(this.renderer === 'html') {
|
||||||
return function() { return template; };
|
return function() { return template; };
|
||||||
} else {
|
} else {
|
||||||
return Handlebars.compile(template);
|
return Handlebars.compile(template);
|
||||||
|
@@ -56,9 +56,15 @@
|
|||||||
// Ajax
|
// Ajax
|
||||||
function ajaxSuccess(data) {
|
function ajaxSuccess(data) {
|
||||||
{% verbatim %}
|
{% verbatim %}
|
||||||
var template = Handlebars.compile("{{ user.name }} ({{ user.age }}) - extra value: {{ extra_value }}");
|
var template = "{{ user.name }} ({{ user.age }}) - extra value: {{ extra_value }}";
|
||||||
{% endverbatim %}
|
{% 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);
|
MailPoet.Modal.loading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user