How to add a click event to an element in bf-menu

how to add a click event to an element in

bf-menu

Nov.20,2021

1, references to jquery

//
    app.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ComponentsSelectionChanged, function(objectData) {
                viewer.render();
                id=objectData.objectId;
                changeStatus(app);
})

//
    function changeStatus(app){
        var contextMenuCallback= function() {
            app.getViewer().render();
            var obj=$("-sharpdoms");
            if(obj.length<0||obj.length==0) {
            var     domc = document.createElement('div');
            var doms = document.createElement('div');
            var domss = document.createElement('div');
            var domt = document.createElement('div');
            var domtt1 = document.createElement('div');
            var domtt2 = document.createElement('div');
                domss.append(domt);
                domss.append(domtt1);
                domss.append(domtt2);
                domc.append(domss);
                domc.append(doms);
                domc.addClass("bf-sub-menu");
                domc.id = "doms";

                doms.addClass("bf-menu-item user-item");
                doms.innerHTML = "";

                domss.addClass("bf-menu");

                domt.addClass("bf-menu-item user-item");
                domt.innerHTML = "";
                domt.id="finish";

                domtt1.addClass("bf-menu-item user-item");
                domtt1.innerHTML = "";
                domtt1.id="starting";

                domtt2.addClass("bf-menu-item user-item");
                domtt2.innerHTML = "";
                domtt2.id="yanqi";
                var oid=id;
                $(".bf-tree-toolbar").next().append(domc);
            }else{
                //$(".bf-tree-toolbar").next().append($("-sharpdoms"))
            }
            $("-sharpfinish").on("click",function(){
                var colorRed = new Glodon.Web.Graphics.Color(0,128,0,1);
                var arr = [id];
                app.getViewer().removeSelectedId(arr);
                app.getViewer().overrideComponentsColorById(arr, colorRed);
                app.getViewer().render();
            })
            $("-sharpstarting").on('click',function(){
                var colorRed = new Glodon.Web.Graphics.Color(255,255,0, 1);
                var arr = [id];
                app.getViewer().removeSelectedId(arr);
                app.getViewer().overrideComponentsColorById(arr, colorRed);
                app.render();
            })
            $("-sharpyanqi").on("click",function(){
                var colorRed = new Glodon.Web.Graphics.Color(255, 0, 0, 1);
                var arr = [id];
                app.getViewer().removeSelectedId(arr);
                app.getViewer().overrideComponentsColorById(arr, colorRed);
                app.render();
            })
            $.each($(".user-item"),function(item){
                $(item).on("click",function(){
                    $(".bf-tree-toolbar").hide();
                })
            })
            //
            app.removeEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ContextMenu, contextMenuCallback)
        }
        
        app.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ContextMenu, contextMenuCallback)
    }

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3c798-43e47.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3c798-43e47.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?