/**
* 右键菜单模块
* date:2019-08-29 License By http://easyweb.vip
*/
layui.define(["jquery"],function(a){var c=layui.jquery;var b={bind:function(e,d){c(e).bind("contextmenu",function(f){b.show(d,f.clientX,f.clientY,f);return false})},show:function(f,d,k,h){var g="left: "+d+"px; top: "+k+"px;";var j='
";b.remove();c("body").append(j);var i=c(".ctxMenu");if(d+i.outerWidth()>b.getPageWidth()){d-=i.outerWidth()}if(k+i.outerHeight()>b.getPageHeight()){k=k-i.outerHeight();if(k<0){k=0}}i.css({"top":k,"left":d});b.setEvents(f,h);c(".ctxMenu-item.haveMore").on("mouseenter",function(){var e=c(this).find(">a");var l=c(this).find(">.ctxMenu-sub");var n=e.offset().top;var m=e.offset().left+e.outerWidth();if(m+l.outerWidth()>b.getPageWidth()){m=e.offset().left-l.outerWidth()}if(n+l.outerHeight()>b.getPageHeight()){n=n-l.outerHeight()+e.outerHeight();if(n<0){n=0}}c(this).find(">.ctxMenu-sub").css({"top":n,"left":m,"display":"block"})}).on("mouseleave",function(){c(this).find(">.ctxMenu-sub").css("display","none")})},remove:function(){var h=parent.window.frames;for(var d=0;d.ctxMenu").remove()}catch(g){}}try{parent.layui.jquery("body>.ctxMenu").remove()}catch(g){}},setEvents:function(d,f){c(".ctxMenu").off("click").on("click","[lay-id]",function(h){var i=c(this).attr("lay-id");var g=e(i);g.click&&g.click(h,f)});function e(k){for(var h=0;h0){var g=e(j.subs);if(g){return g}}}}}},getHtml:function(e,d){var h="";for(var f=0;f0){h+='