Skip to content
Snippets Groups Projects
Select Git revision
  • cf49c3cda093cedc4101320f8a8cafca9dc618c9
  • master default protected
2 results

TandemPlugin.js

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    TandemPlugin.js 984 B
    
    STUDIP.TandemPlugin = {
        addMotherLanguage: function() {
            var template = jQuery('#motherLanguageRowTemplate');
            var tbody = jQuery(template).parent();
            
            var new_row = jQuery(template).clone();
            new_row.id = null;
            
            var status_input = jQuery(new_row).find('input.EntryStatus')[0];
            
            if(!status_input) { console.log('no status input!'); }
            
            jQuery(status_input).val('K');
            jQuery(new_row).removeAttr('style');
            jQuery(new_row).appendTo(tbody);
        },
        
        deleteMotherLanguage: function(caller, language_id) {
            var row = jQuery(caller).parent().parent();
            
            if(language_id != null) {
                jQuery(row).attr('style', 'display:none;');
                //entry exists in the database:
                var delete_input = jQuery(row).find('.EntryStatus');
                jQuery(delete_input).val('D');
            } else {
                jQuery(row).remove();
            }
        }
    };