<commit_before>/**
 * creates a genomeTable object representing the table showing all genomes
 * currently in the visualisation. features: reorder by dragging, autosort,
 * remove individual genomes, remove all genome.
 *
 * @param <Map> args.genomes Map of genomes (by assembly id)
 * @param <Pancore> args.pancore Pancore object
 */
var constructGenomeTable = function constructGenomeTable(args) {
    /*************** Private variables ***************/

    var that = {},
        genomes = args.genomes,
        pancore = args.pancore,
        lca;

    /*************** Private methods ***************/

    /**
     * Initializes the table
     */
    function init() {
        initAutoSort();
        initDrag();

        $("#remove-all").click(pancore.clearAllData);
    }

    /**
     * Initializes auto sort
     */
    function initAutoSort() {
        // Add handler to the autosort-button
        $("#autosort").mouseenter(function () {
            if (!$("#autosort").hasClass("open")) {
                $("#autosort-button").dropdown("toggle");
            }
        });
        $("#autosort").mouseleave(function () {
            if ($("#autosort").hasClass("open")) {
                $("#autosort-button").dropdown("toggle");
            }
        });
        $("#autosort ul a").click(runAutosort);
        $("#autosort ul a").tooltip({placement : "right", container : "body"});
    }

    /**
     * Initializes sortable
     */
    function initDrag() {
        dragula([$("#genomes_table tbody").get(0)], {
            direction: 'vertical'
        }).on("drop", function () {
            pancore.updateOrder(calculateTablePositions());
            that.update();
        });
        /*$("#genomes_table tbody").sortable({
            axis: 'y',
            containment: '.left-col',
            cursor: 'url(/closedhand.cur) 7 5, move',
            stop: function () {
                pancore.updateOrder(calculateTablePositions());
                that.update();
            }
        });*/
    }
<commit_msg>don't drag untill done<commit_after>/**
 * creates a genomeTable object representing the table showing all genomes
 * currently in the visualisation. features: reorder by dragging, autosort,
 * remove individual genomes, remove all genome.
 *
 * @param <Map> args.genomes Map of genomes (by assembly id)
 * @param <Pancore> args.pancore Pancore object
 */
var constructGenomeTable = function constructGenomeTable(args) {
    /*************** Private variables ***************/

    var that = {},
        genomes = args.genomes,
        pancore = args.pancore,
        lca;

    /*************** Private methods ***************/

    /**
     * Initializes the table
     */
    function init() {
        initAutoSort();
        initDrag();

        $("#remove-all").click(pancore.clearAllData);
    }

    /**
     * Initializes auto sort
     */
    function initAutoSort() {
        // Add handler to the autosort-button
        $("#autosort").mouseenter(function () {
            if (!$("#autosort").hasClass("open")) {
                $("#autosort-button").dropdown("toggle");
            }
        });
        $("#autosort").mouseleave(function () {
            if ($("#autosort").hasClass("open")) {
                $("#autosort-button").dropdown("toggle");
            }
        });
        $("#autosort ul a").click(runAutosort);
        $("#autosort ul a").tooltip({placement : "right", container : "body"});
    }

    /**
     * Initializes sortable
     */
    function initDrag() {
        dragula([$("#genomes_table tbody").get(0)], {
            direction: 'vertical',
            moves: function (el) {
              return d3.select(el).datum().status === "Done";
            }
        })
        .on("drop", function () {
            pancore.updateOrder(calculateTablePositions());
            that.update();
        });
    }

{'fraction_non_alphanumeric': 0.179943284351637, 'fraction_numerical': 0.001288992008249549, 'mean_word_length': 2.111467522052927, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4731829', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1070, 'n_words': 228}