/*! layer mobile-v2.0 弹层组件移动版 license lgpl http://layer.layui.com/mobile by 贤心 */ ;!function(a){"use strict";var b=document,c="queryselectorall",d="getelementsbyclassname",e=function(a){return b[c](a)},f={type:0,shade:!0,shadeclose:!0,fixed:!0,anim:"scale"},g={extend:function(a){var b=json.parse(json.stringify(f));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};g.touch=function(a,b){a.addeventlistener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layui-m-layer"],j=function(a){var b=this;b.config=g.extend(a),b.view()};j.prototype.view=function(){var a=this,c=a.config,f=b.createelement("div");a.id=f.id=i[0]+h,f.setattribute("class",i[0]+" "+i[0]+(c.type||0)),f.setattribute("index",h);var g=function(){var a="object"==typeof c.title;return c.title?'

'+(a?c.title[0]:c.title)+"

":""}(),j=function(){"string"==typeof c.btn&&(c.btn=[c.btn]);var a,b=(c.btn||[]).length;return 0!==b&&c.btn?(a=''+c.btn[0]+"",2===b&&(a=''+c.btn[1]+""+a),'
'+a+"
"):""}();if(c.fixed||(c.top=c.hasownproperty("top")?c.top:100,c.style=c.style||"",c.style+=" top:"+(b.body.scrolltop+c.top)+"px"),2===c.type&&(c.content='

'+(c.content||"")+"

"),c.skin&&(c.anim="up"),"msg"===c.skin&&(c.shade=!1),f.innerhtml=(c.shade?"
':"")+'
"+g+'
'+c.content+"
"+j+"
",!c.type||2===c.type){var k=b[d](i[0]+c.type),l=k.length;l>=1&&layer.close(k[0].getattribute("index"))}document.body.appendchild(f);var m=a.elem=e("#"+a.id)[0];c.success&&c.success(m),a.index=h++,a.action(c,m)},j.prototype.action=function(a,b){var c=this;a.time&&(g.timer[c.index]=settimeout(function(){layer.close(c.index)},1e3*a.time));var e=function(){var b=this.getattribute("type");0==b?(a.no&&a.no(),layer.close(c.index)):a.yes?a.yes(c.index):layer.close(c.index)};if(a.btn)for(var f=b[d]("layui-m-layerbtn")[0].children,h=f.length,i=0;h>i;i++)g.touch(f[i],e);if(a.shade&&a.shadeclose){var j=b[d]("layui-m-layershade")[0];g.touch(j,function(){layer.close(c.index,a.end)})}a.end&&(g.end[c.index]=a.end)},a.layer={v:"2.0",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var c=e("#"+i[0]+a)[0];c&&(c.innerhtml="",b.body.removechild(c),cleartimeout(g.timer[a]),delete g.timer[a],"function"==typeof g.end[a]&&g.end[a](),delete g.end[a])},closeall:function(){for(var a=b[d](i[0]),c=0,e=a.length;e>c;c++)layer.close(0|a[0].getattribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var a=document.scripts,c=a[a.length-1],d=c.src,e=d.substring(0,d.lastindexof("/")+1);c.getattribute("merge")||document.head.appendchild(function(){var a=b.createelement("link");return a.href=e+"need/layer.css?2.0",a.type="text/css",a.rel="stylesheet",a.id="layermcss",a}())}()}(window);