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

« back to all changes in this revision

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

Merge from submissions-admin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
function add_project(){
20
20
 
21
 
    $(this).slideUp();
 
21
    $(this.parentNode).slideToggle();
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
 
        if (projectlist.hasClass("emptylist")){
28
 
            projectlist.children().slideUp();
29
 
            projectlist.removeClass("emptylist");
30
 
        }
 
27
        projectlist.children(".list_empty_indicator").remove()
31
28
        $(new_element).appendTo(projectlist).hide().slideDown();
32
29
    };
33
30
 
48
45
        $('#projectset_' + response.projectset_id).hide();
49
46
        $('#projectset_' + response.projectset_id).slideDown();
50
47
        $("#add_projectset").removeAttr('disabled');
 
48
        $(".add-project-link").click(show_add);
51
49
    };
52
50
 
53
51
    var data = serializeForm($("#new_projectset_form"));