mirror of
https://github.com/kennethreitz-archive/www.gittip.com.git
synced 2026-06-21 15:50:59 +00:00
b2da48d15d
This rationalizes the navigation on profile pages, allowing users and admins to view all pages under /profile/ and to take all appropriate actions on each page.
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
$(document).ready(function()
|
|
{
|
|
// Wire up is_suspicious toggle.
|
|
// =============================
|
|
|
|
$('label.is-suspicious-knob').click(function()
|
|
{
|
|
var participant_id = $(this).attr('data-participant-id');
|
|
jQuery.ajax(
|
|
{ url: '/' + participant_id + '/toggle-is-suspicious.json'
|
|
, type: 'POST'
|
|
, dataType: 'json'
|
|
, success: function(data)
|
|
{
|
|
if (data.is_suspicious)
|
|
$(".on-profile").addClass('is-suspicious');
|
|
else
|
|
$(".on-profile").removeClass('is-suspicious');
|
|
$('INPUT.is-suspicious-knob').attr( 'checked'
|
|
, data.is_suspicious
|
|
);
|
|
}
|
|
, error: function() {
|
|
alert( "Failed to change is_suspicious. Please "
|
|
+ "try again."
|
|
);
|
|
}
|
|
}
|
|
);
|
|
});
|
|
});
|