2012-04-25 22:48:27 +02:00
|
|
|
/**
|
|
|
|
* OpenSlides participants functions
|
|
|
|
*
|
|
|
|
* :copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
|
|
|
|
* :license: GNU GPL, see LICENSE for more details.
|
|
|
|
*/
|
|
|
|
|
2012-04-02 08:35:10 +02:00
|
|
|
$(function() {
|
2013-01-31 10:19:56 +01:00
|
|
|
// change participant status (on/off)
|
2012-04-02 08:35:10 +02:00
|
|
|
$('.status_link').click(function(event) {
|
|
|
|
event.preventDefault();
|
2013-01-31 10:19:56 +01:00
|
|
|
var link = $(this);
|
2012-04-02 08:35:10 +02:00
|
|
|
$.ajax({
|
|
|
|
type: 'GET',
|
2013-01-31 10:19:56 +01:00
|
|
|
url: $(this).attr('href'),
|
2012-04-02 08:35:10 +02:00
|
|
|
dataType: 'json',
|
|
|
|
success: function(data) {
|
|
|
|
if (data.active) {
|
2013-01-31 10:19:56 +01:00
|
|
|
newclass = 'icon-on';
|
|
|
|
link.addClass('btn-success');
|
2012-04-02 08:35:10 +02:00
|
|
|
} else {
|
2013-01-31 10:19:56 +01:00
|
|
|
newclass = 'icon-off';
|
|
|
|
link.removeClass('btn-success');
|
2012-04-02 08:35:10 +02:00
|
|
|
}
|
2013-01-31 10:19:56 +01:00
|
|
|
link.children('i').removeClass('icon-off icon-on').addClass(newclass);
|
|
|
|
link.attr('href', data.link);
|
2012-04-02 08:35:10 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
2012-08-10 19:19:41 +02:00
|
|
|
});
|