diff --git a/openslides/projector/static/javascript/projector.js b/openslides/projector/static/javascript/projector.js index c701d77f6..4e0ee8714 100644 --- a/openslides/projector/static/javascript/projector.js +++ b/openslides/projector/static/javascript/projector.js @@ -5,16 +5,22 @@ * :license: GNU GPL, see LICENSE for more details. */ +content_hash = null; + function presentation_reload() { + if ($('#config > #ajax').html() == 'on') { $.ajax({ type: 'GET', url: '/projector/', dataType: 'json', - data: '', success: function(data) { $('#currentTime').removeClass('ajax_error'); - $('#content').html(data.content); + var new_content_hash = data['content_hash']; + if (new_content_hash != content_hash) { + $('#content').html(data.content); + content_hash = new_content_hash; + } $('#scrollcontent').html(data.scrollcontent); document.title = data.title; $('#currentTime').html(data.time); diff --git a/openslides/projector/views.py b/openslides/projector/views.py index 6ad6b0538..8a8d5612a 100644 --- a/openslides/projector/views.py +++ b/openslides/projector/views.py @@ -231,6 +231,7 @@ class Projector(TemplateView, AjaxMixin): scrollcontent = render_block_to_string(self.get_template_names()[0], 'scrollcontent', self.data) context = super(Projector, self).get_ajax_context(**kwargs) + content_hash = hash(content) context.update({ 'content': content, 'scrollcontent': scrollcontent, @@ -239,6 +240,7 @@ class Projector(TemplateView, AjaxMixin): 'title': self.data['title'], 'bigger': config['bigger'], 'up': config['up'], + 'content_hash': content_hash, }) return context