ToMoral.CRM/JS/DragFlow/DragFlow.JQuery.js

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/// <reference path="jquery-1.4.1-vsdoc.js" />
/*
*  DragFlow JQuery方法类,主要包括:
*  1、初始化端点、设置目标节点、源节点;
*  2、设置右键菜单;
*  3、设置所有元素的可拖拽性、目标节点、源节点等
*  4、设置右键菜单;
*  Author:limq
*  date:2012.12.08
*/
(function ($) {
    // 初始化端点,把所有带有ep样式元素的父节点设置为源节点
    DragFlow.initEndpoints = function (nextColour) {
        $(".ep").each(function (i, e) {
            var p = $(e).parent();
            jsPlumb.makeSource($(e),
            {
                parent: p,
                //anchor:"BottomCenter",
                anchor: "Continuous",
                connector: ["Flowchart", { curviness: 20 }],
                connectorStyle: { strokeStyle: "black", lineWidth: 1 },
                endpoint: "Blank",
                maxConnections: 5,
                onMaxConnections: function (info, e) {
                    alert("Maximum connections (" + info.maxConnections + ") reached");
                }
            });
        });
    };
    // 设置元素为连接源节点
    DragFlow.makeSourceById = function (newid) {
        jsPlumb.makeSource($("#" + newid + "").children(".ep"),
                            {
                                parent: newid,
                                anchor: "Continuous",
                                connector: ["Flowchart", { curviness: 20 }],
                                connectorStyle: { strokeStyle: "black", lineWidth: 1 },
                                endpoint: "Blank",
                                maxConnections: 4,
                                onMaxConnections: function (info, e) {
                                    alert("最大连接数为 (" + info.maxConnections + ") !!");
                                }
                            });
    }
    // 设置连接目标节点
    DragFlow.makeTargetById = function (newid) {
        jsPlumb.makeTarget(newid, {
            dropOptions: { hoverClass: "dragHover" },
            anchor: "Continuous",
            endpoint: "Blank"
            //anchor:"TopCenter"			
        });
    }
    // 设置元素右键菜单
    DragFlow.makecontextmenu = function (newid, isAllElements) {
        var els = $("#" + newid);
        if (isAllElements) {
            els = $(".component");
        }
后面还有 29 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。