Merge pull request #593 from ostcar/master

Fixed Error in new Overlay API
This commit is contained in:
Oskar Hahn 2013-04-15 06:48:22 -07:00
commit fc36ef2d7b
2 changed files with 5 additions and 3 deletions

View File

@ -166,5 +166,7 @@ class Overlay(object):
return self.get_projector_html() return self.get_projector_html()
def is_active(self): def is_active(self):
return (self.name in config['projector_active_overlays'] and return self.name in config['projector_active_overlays']
self.get_projector_html() is not None)
def show_on_projector(self):
return self.is_active and self.get_projector_html() is not None

View File

@ -86,7 +86,7 @@ class Projector(TemplateView, AjaxMixin):
# Do not show overlays on slide preview # Do not show overlays on slide preview
if self.kwargs['sid'] is None: if self.kwargs['sid'] is None:
for receiver, overlay in projector_overlays.send(sender=self): for receiver, overlay in projector_overlays.send(sender=self):
if overlay.is_active(): if overlay.show_on_projector():
data['overlays'].append({'name': overlay.name, data['overlays'].append({'name': overlay.name,
'html': overlay.get_projector_html()}) 'html': overlay.get_projector_html()})