clear overlay-message via ajax
This commit is contained in:
parent
ad8d5585f1
commit
03fe1f84dd
@ -84,6 +84,7 @@ $(function() {
|
||||
}
|
||||
$( "#iframe" ).css('zoom', '0.25');
|
||||
}
|
||||
|
||||
// activate an element to show it on projector
|
||||
$('.activate_link').click(function(event) {
|
||||
event.preventDefault();
|
||||
@ -183,7 +184,10 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
$('#overlay-form').ajaxForm(function() {
|
||||
alert("Thank you for your comment!");
|
||||
$('#overlay_message').ajaxForm({
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
$('#overlay_message_text').val(data['overlay_message']);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,8 +1,8 @@
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
{% load tags %}
|
||||
<form id="overlay-form" action="" method="post" style="display:inline">{% csrf_token %}
|
||||
<input name='message_text' type='text' style='width: 40%' value="{% get_config 'projector_message' %}">
|
||||
<form id="overlay_message" action="" method="post" style="display:inline">{% csrf_token %}
|
||||
<input id="overlay_message_text" name='message_text' type='text' style='width: 40%' value="{% get_config 'projector_message' %}">
|
||||
<button type="submit" class="button" name='message'>
|
||||
<span class="icon ok">{% trans 'Apply' %}</span>
|
||||
</button>
|
||||
|
@ -65,9 +65,14 @@ class ControlView(TemplateView, AjaxMixin):
|
||||
overlay.active = False
|
||||
overlay.save()
|
||||
if request.is_ajax():
|
||||
return ajax_get(request, *args, **kwargs)
|
||||
return self.ajax_get(request, *args, **kwargs)
|
||||
return self.get(request, *args, **kwargs)
|
||||
|
||||
def get_ajax_context(self, **kwargs):
|
||||
return {
|
||||
'overlay_message': config['projector_message'],
|
||||
}
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(ControlView, self).get_context_data(**kwargs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user