~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/subject-media/project.js

  • Committer: William Grant
  • Date: 2009-06-29 06:43:20 UTC
  • Revision ID: grantw@unimelb.edu.au-20090629064320-vrahlocbh0d5852w
Allow admins to set the admin flag with ivle-adduser (issue #151).

ivle-makeuser was also renamed to ivle-adduser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
$(document).ready(function(){
2
2
    $("#new_projectset_form").submit(add_projectset);
3
3
    $(".new_project").submit(add_project);
4
 
    $('li').slideDown();
 
4
    $('li').show();
5
5
    $('.add-project-link').click(show_add);
6
6
});
7
7
 
18
18
 
19
19
function add_project(){
20
20
 
21
 
    $(this.parentNode).slideToggle();
 
21
    $(this).slideToggle('fast');
22
22
    
23
23
    function callback(xhr) {
24
24
        var response = JSON.parse(xhr.responseText);
25
25
        var projectlist = $('#projectslist_' + response.projectset_id);
26
26
        var new_element = response.html.split('\n').slice(1).join('\n');
27
27
        projectlist.children(".list_empty_indicator").remove()
28
 
        $(new_element).appendTo(projectlist).hide().slideDown();
 
28
        add_section = projectlist.children(".add-project");
 
29
        $(add_section).before(new_element).hide().slideDown();
29
30
    };
30
31
 
31
32
    var data = serializeForm($(this));