plugin's parent render method called only in edit or ajax modes
This commit is contained in:
parent
da33884cd2
commit
6813853a27
|
@ -13,12 +13,12 @@ class AjaxTextPlugin(TextPlugin):
|
|||
return t.render(context)
|
||||
|
||||
def render(self, context, instance, placeholder):
|
||||
context = super(AjaxTextPlugin, self).render(context, instance, placeholder)
|
||||
context['object'] = instance
|
||||
request = context.get('request')
|
||||
edit_mode = request and 'edit' in request.GET
|
||||
is_ajax = request and request.is_ajax()
|
||||
context['object'] = instance
|
||||
if edit_mode or is_ajax:
|
||||
context = super(AjaxTextPlugin, self).render(context, instance, placeholder)
|
||||
return context
|
||||
|
||||
context['body'] = self.get_ajax_body(instance, context)
|
||||
|
|
Reference in New Issue