GoalModelEditor/FrontEnd/public/js/projectEdit/projectEdit.js
/**
 * if no "dd-empty" is existed, append new cluster
 * to make sure there is always at least one "new" cluster
 */
if no "dd-empty" is existed, append new cluster
to make sure there is always at least one "new" cluster
if no " dd - empty " is existed append new cluster to make sure there is always at least one " new " cluster
function appendCluster() {
    if (!$(".dd-empty").length) {
        let cluster = $("#cluster");
        clusterNumber++;
        cluster.append(
            '<div class="dd py-3" id=cluster_' +
            clusterNumber.toString() +
            ">" +
            "</div>"
        );
        drop_zone(clusterNumber);
        $(".dd").nestable({
            onDragStart: function (l, e) {
                addNoChildrenClass();
            },
            callback: function (l, e) {
                appendCluster();
                removeCluster();
            },
            scroll: true
        });
    }
}
function appendCluster ( ) { if ( ! $ ( ".dd-empty" ) . length ) { let cluster = $ ( "#cluster" ) ; clusterNumber ++ ; cluster . append ( '<div class="dd py-3" id=cluster_' + clusterNumber . toString ( ) + ">" + "</div>" ) ; drop_zone ( clusterNumber ) ; $ ( ".dd" ) . nestable ( { onDragStart : function ( l , e ) { addNoChildrenClass ( ) ; } , callback : function ( l , e ) { appendCluster ( ) ; removeCluster ( ) ; } , scroll : true } ) ; } }
if no "dd-empty" is existed, append new cluster
 to make sure there is always at least one "new" cluster
if no " dd - empty " is existed append new cluster to make sure there is always at least one " new " cluster
//activate nestable2 function // get type of dragged element // let type = $(e).children(".dd-handle").attr("class").split(" ")[0]; // console.log(type); //when start dragging, trigger addNoChildrenClass method // l is the main container // e is the element that was moved //when finish dropping, trigger these methods to make "dd-empty" is always one //enable auto scrolling method while dragging