局部调整

pull/5/head^2
sentsin 2016-11-11 11:46:21 +08:00
parent f737ef8287
commit 997a4901cf
6 changed files with 11 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/** layui-v1.0.3 LGPL license By www.layui.com */
;layui.define("jquery",function(i){"use strict";var t=layui.jquery,a=(layui.hint(),layui.device()),e="element",n="layui-this",l="layui-show",s=function(){this.config={}};s.prototype.set=function(i){var a=this;return t.extend(!0,a.config,i),a},s.prototype.on=function(i,t){return layui.onevent(e,i,t)},s.prototype.init=function(i){var s={tabClick:function(i,a){var s=t(this),a=a||s.index(),o=s.parents(".layui-tab"),c=o.children(".layui-tab-content").children(".layui-tab-item"),u=o.attr("lay-filter");s.addClass(n).siblings().removeClass(n),c.eq(a).addClass(l).siblings().removeClass(l),layui.event.call(this,e,"tab("+u+")",{elem:o,index:a})},tabAuto:function(){var i="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",o=this;t(".layui-tab").each(function(){var c=t(this),u=c.children(".layui-tab-title"),r=(c.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),d=t('<span class="layui-unselect layui-tab-bar" '+r+"><i "+r+' class="layui-icon">&#xe61a;</i></span>');if(o===window&&8!=a.ie&&s.hideTabMore(!0),c.attr("lay-allowClose")&&!u.find("li").find("."+l)[0]){var h=t('<i class="layui-icon layui-unselect '+l+'">&#x1006;</i>');h.on("click",function(){var i=t(this).parent(),a=i.index(),e=i.parents(".layui-tab"),l=e.children(".layui-tab-content").children(".layui-tab-item");i.hasClass(n)&&(i.next()[0]?s.tabClick.call(i.next()[0],{},a+1):i.prev()[0]&&s.tabClick.call(i.prev()[0],{},a-1)),i.remove(),l.eq(a).remove()}),u.find("li").append(h)}if(u.prop("scrollWidth")>u.outerWidth()+1){if(u.find("."+e)[0])return;u.append(d),d.on("click",function(t){u[this.title?"removeClass":"addClass"](i),this.title=this.title?"":"收缩"})}else u.find("."+e).remove()})},hideTabMore:function(i){var a=t(".layui-tab-title");i!==!0&&"tabmore"===i.target.getAttribute("lay-stope")||(a.removeClass("layui-tab-more"),a.find(".layui-tab-bar").attr("title",""))}},o={tab:function(){var i=".layui-tab-title li";s.tabAuto.call({}),c.off("click",i,s.tabClick).on("click",i,s.tabClick),t(window).off("resize",s.tabAuto).on("resize",s.tabAuto),t(document).off("click",s.hideTabMore).on("click",s.hideTabMore)},nav:function(){var i,e,n,l=".layui-nav",s="layui-nav-item",o="layui-nav-bar",c="layui-nav-tree",u="layui-nav-child",r="layui-nav-more",d=200,h=function(a,l){var s=t(this),o=s.find("."+u);l.hasClass(c)?a.css({top:s.position().top,height:s.children("a").height(),opacity:1}):(o.addClass("layui-anim layui-anim-upbit"),a.css({left:s.position().left+parseFloat(s.css("marginLeft")),top:s.position().top+s.height()-5}),i=setTimeout(function(){a.css({width:s.width(),opacity:1})},d),clearTimeout(n),"block"===o.css("display")&&clearTimeout(e),e=setTimeout(function(){o.show(),s.find("."+r).addClass(r+"d")},300))};t(l).each(function(){var l=t(this),f=t('<span class="'+o+'"></span>'),y=l.find("."+s);l.find("."+o)[0]||a.ie&&a.ie<10||(l.append(f),y.on("mouseenter",function(){h.call(this,f,l)}).on("mouseleave",function(){l.hasClass(c)||(clearTimeout(e),e=setTimeout(function(){l.find("."+u).hide(),l.find("."+r).removeClass(r+"d")},300))}),l.on("mouseleave",function(){clearTimeout(i),n=setTimeout(function(){l.hasClass(c)?f.css({height:0,top:f.position().top+f.height()/2,opacity:0}):f.css({width:0,left:f.position().left+f.width()/2,opacity:0})},d)})),y.each(function(){var i=t(this),a=i.find("."+u);if(a[0]&&!i.find("."+r)[0]){if(i.children("a").append('<span class="'+r+'"></span>'),!l.hasClass(c))return;i.children("a").on("click",function(){t(this);"none"===a.css("display")?i.addClass(s+"ed"):i.removeClass(s+"ed")})}})})},breadcrumb:function(){var i=".layui-breadcrumb";t(i).each(function(){var i=t(this),a=i.attr("lay-separator")||">",e=i.find("a");e.each(function(i){i!==e.length-1&&t(this).append("<span>"+a+"</span>")}),i.css("visibility","visible")})}};return layui.each(o,function(i,t){t()})};var o=new s,c=t("body");o.init(),i(e,function(i){return o.set(i)})});
;layui.define("jquery",function(i){"use strict";var t=layui.jquery,a=(layui.hint(),layui.device()),e="element",n="layui-this",l="layui-show",s=function(){this.config={}};s.prototype.set=function(i){var a=this;return t.extend(!0,a.config,i),a},s.prototype.on=function(i,t){return layui.onevent(e,i,t)},s.prototype.init=function(i){var s={tabClick:function(i,a){var s=t(this),a=a||s.index(),o=s.parents(".layui-tab"),c=o.children(".layui-tab-content").children(".layui-tab-item"),u=o.attr("lay-filter");s.addClass(n).siblings().removeClass(n),c.eq(a).addClass(l).siblings().removeClass(l),layui.event.call(this,e,"tab("+u+")",{elem:o,index:a})},tabAuto:function(){var i="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",o=this;t(".layui-tab").each(function(){var c=t(this),u=c.children(".layui-tab-title"),r=(c.children(".layui-tab-content").children(".layui-tab-item"),'lay-stope="tabmore"'),d=t('<span class="layui-unselect layui-tab-bar" '+r+"><i "+r+' class="layui-icon">&#xe61a;</i></span>');if(o===window&&8!=a.ie&&s.hideTabMore(!0),c.attr("lay-allowClose")&&!u.find("li").find("."+l)[0]){var h=t('<i class="layui-icon layui-unselect '+l+'">&#x1006;</i>');h.on("click",function(){var i=t(this).parent(),a=i.index(),e=i.parents(".layui-tab"),l=e.children(".layui-tab-content").children(".layui-tab-item");i.hasClass(n)&&(i.next()[0]?s.tabClick.call(i.next()[0],{},a+1):i.prev()[0]&&s.tabClick.call(i.prev()[0],{},a-1)),i.remove(),l.eq(a).remove()}),u.find("li").append(h)}if(u.prop("scrollWidth")>u.outerWidth()+1){if(u.find("."+e)[0])return;u.append(d),d.on("click",function(t){u[this.title?"removeClass":"addClass"](i),this.title=this.title?"":"收缩"})}else u.find("."+e).remove()})},hideTabMore:function(i){var a=t(".layui-tab-title");i!==!0&&"tabmore"===i.target.getAttribute("lay-stope")||(a.removeClass("layui-tab-more"),a.find(".layui-tab-bar").attr("title",""))}},o={tab:function(){var i=".layui-tab-title li";s.tabAuto.call({}),c.off("click",i,s.tabClick).on("click",i,s.tabClick),t(window).off("resize",s.tabAuto).on("resize",s.tabAuto),c.off("click",s.hideTabMore).on("click",s.hideTabMore)},nav:function(){var i,e,n,l=".layui-nav",s="layui-nav-item",o="layui-nav-bar",c="layui-nav-tree",u="layui-nav-child",r="layui-nav-more",d=200,h=function(a,l){var s=t(this),o=s.find("."+u);l.hasClass(c)?a.css({top:s.position().top,height:s.children("a").height(),opacity:1}):(o.addClass("layui-anim layui-anim-upbit"),a.css({left:s.position().left+parseFloat(s.css("marginLeft")),top:s.position().top+s.height()-5}),i=setTimeout(function(){a.css({width:s.width(),opacity:1})},d),clearTimeout(n),"block"===o.css("display")&&clearTimeout(e),e=setTimeout(function(){o.show(),s.find("."+r).addClass(r+"d")},300))};t(l).each(function(){var l=t(this),f=t('<span class="'+o+'"></span>'),y=l.find("."+s);l.find("."+o)[0]||a.ie&&a.ie<10||(l.append(f),y.on("mouseenter",function(){h.call(this,f,l)}).on("mouseleave",function(){l.hasClass(c)||(clearTimeout(e),e=setTimeout(function(){l.find("."+u).hide(),l.find("."+r).removeClass(r+"d")},300))}),l.on("mouseleave",function(){clearTimeout(i),n=setTimeout(function(){l.hasClass(c)?f.css({height:0,top:f.position().top+f.height()/2,opacity:0}):f.css({width:0,left:f.position().left+f.width()/2,opacity:0})},d)})),y.each(function(){var i=t(this),a=i.find("."+u);if(a[0]&&!i.find("."+r)[0]){if(i.children("a").append('<span class="'+r+'"></span>'),!l.hasClass(c))return;i.children("a").on("click",function(){t(this);"none"===a.css("display")?i.addClass(s+"ed"):i.removeClass(s+"ed")})}})})},breadcrumb:function(){var i=".layui-breadcrumb";t(i).each(function(){var i=t(this),a=i.attr("lay-separator")||">",e=i.find("a");e.each(function(i){i!==e.length-1&&t(this).append("<span>"+a+"</span>")}),i.css("visibility","visible")})}};return layui.each(o,function(i,t){t()})};var o=new s,c=t(document);o.init(),i(e,function(i){return o.set(i)})});

View File

@ -1,2 +1,2 @@
/** layui-v1.0.3 LGPL license By www.layui.com */
;layui.define("layer",function(e){"use strict";var i=layui.jquery,a=layui.layer,t=layui.hint(),n=layui.device(),l="form",c=".layui-form",s="layui-this",r=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:[/^\d+$/,"只能填写数字"],date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};r.prototype.set=function(e){var a=this;return i.extend(!0,a.config,e),a},r.prototype.verify=function(e){var a=this;return i.extend(!0,a.config.verify,e),a},r.prototype.on=function(e,i){return layui.onevent(l,e,i)},r.prototype.render=function(e){var a=this,n={select:function(){var e="请选择",a="layui-form-select",t="layui-select-title",n=i(c).find("select"),r=function(e,n){i(e.target).parent().hasClass(t)&&!n||i("."+a).removeClass(a+"ed")},o=function(e){var n=i(this),c=e.find("."+t);c.on("click",function(i){e.hasClass(a+"ed")?e.removeClass(a+"ed"):(r(i,!0),e.addClass(a+"ed"))}),e.find("dl>dd").on("click",function(){var e=i(this),a=e.attr("lay-value"),t=n.attr("lay-filter");n.val(a).removeClass("layui-form-danger"),c.find("input").val(e.text()),e.addClass(s).siblings().removeClass(s),layui.event(l,"select("+t+")",{elem:n[0],value:a})}),e.find("dl>dt").on("click",function(e){layui.stope(e)}),i(document).off("click",r).on("click",r)};n.each(function(n,l){var c=i(this),r=c.next("."+a),u=l.value,d=i(l.options[l.selectedIndex]),f=i(['<div class="layui-unselect '+a+'">','<div class="'+t+'"><input type="text" placeholder="'+(l.options[0].innerHTML?l.options[0].innerHTML:e)+'" value="'+(u?d.html():"")+'" readonly class="layui-input layui-unselect">','<i class="layui-edge"></i></div>','<dl class="layui-anim layui-anim-upbit'+(c.find("optgroup")[0]?" layui-select-group":"")+'">'+function(e){var i=[];return layui.each(e,function(e,a){(0!==e||a.value)&&("optgroup"===a.tagName.toLowerCase()?i.push("<dt>"+a.label+"</dt>"):i.push('<dd lay-value="'+a.value+'" '+(u===a.value?'class="'+s+'"':"")+">"+a.innerHTML+"</dd>"))}),i.join("")}(c.find("*"))+"</dl>","</div>"].join(""));r[0]&&r.remove(),c.after(f),o.call(this,f)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},a=i(c).find("input[type=checkbox]"),t=function(e,a){var t=i(this);e.on("click",function(){var i=t.attr("lay-filter");t[0].checked?(t[0].checked=!1,e.removeClass(a[1])):(t[0].checked=!0,e.addClass(a[1])),layui.event(l,a[2]+"("+i+")",{elem:t[0],value:t[0].value})})};a.each(function(a,n){var l=i(this),c=l.attr("lay-skin");"switch"===c&&(c="_"+c);var s=e[c]||e.checkbox,r=l.next("."+s[0]),o=i(['<div class="layui-unselect '+s[0]+(n.checked?" "+s[1]:"")+'">',{_switch:"<i></i>"}[c]||"<span>"+(n.title||"勾选")+'</span><i class="layui-icon">&#xe618;</i>',"</div>"].join(""));r[0]&&r.remove(),l.after(o),t.call(this,o,s)})},radio:function(){var e="layui-form-radio",a=["&#xe643;","&#xe63f;"],t=i(c).find("input[type=radio]"),n=function(t){var n=i(this),s="layui-anim-scaleSpring";t.on("click",function(){var r=n[0].name,o=n.parents(c),u=n.attr("lay-filter"),d=o.find("input[name="+r+"]");layui.each(d,function(){var t=i(this).next("."+e);this.checked=!1,t.removeClass(e+"ed"),t.find(".layui-icon").removeClass(s).html(a[1])}),n[0].checked=!0,t.addClass(e+"ed"),t.find(".layui-icon").addClass(s).html(a[0]),layui.event(l,"radio("+u+")",{elem:n[0],value:n[0].value})})};t.each(function(t,l){var c=i(this),s=c.next("."+e),r=i(['<div class="layui-unselect '+e+(l.checked?" "+e+"ed":"")+'">','<i class="layui-anim layui-icon">'+a[l.checked?0:1]+"</i>","<span>"+(l.title||"未命名")+"</span>","</div>"].join(""));s[0]&&s.remove(),c.after(r),n.call(this,r)})}};return e?n[e]?n[e]():t.error("不支持的"+e+"表单渲染"):layui.each(n,function(e,i){i()}),a};var o=function(){var e=i(this),t=u.config.verify,s=null,r="layui-form-danger",o={},d=e.parents(c),f=d.find("*[lay-verify]"),y=e.parents("form")[0],v=d.find("input,select,textarea"),h=e.attr("lay-filter");return layui.each(f,function(e,l){var c=i(this),o=c.attr("lay-verify"),u="",d=c.val(),f="function"==typeof t[o];if(c.removeClass(r),t[o]&&(f?u=t[o](d,l):!t[o][0].test(d)))return a.msg(u||t[o][1],{icon:5,shift:6}),n.android||n.ios||l.focus(),c.addClass(r),s=!0}),!s&&(layui.each(v,function(e,i){i.name&&(/^checkbox|radio$/.test(i.type)&&!i.checked||(o[i.name]=i.value))}),layui.event.call(this,l,"submit("+h+")",{elem:this,form:y,field:o}))},u=new r,d=i("body");u.render(),d.on("reset",c,function(){setTimeout(function(){u.render()},50)}),d.on("submit",c,o).on("click","*[lay-submit]",o),e(l,function(e){return u.set(e)})});
;layui.define("layer",function(e){"use strict";var i=layui.jquery,a=layui.layer,t=layui.hint(),n=layui.device(),l="form",c=".layui-form",s="layui-this",r=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:[/^\d+$/,"只能填写数字"],date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};r.prototype.set=function(e){var a=this;return i.extend(!0,a.config,e),a},r.prototype.verify=function(e){var a=this;return i.extend(!0,a.config.verify,e),a},r.prototype.on=function(e,i){return layui.onevent(l,e,i)},r.prototype.render=function(e){var a=this,n={select:function(){var e="请选择",a="layui-form-select",t="layui-select-title",n=i(c).find("select"),r=function(e,n){i(e.target).parent().hasClass(t)&&!n||i("."+a).removeClass(a+"ed")},o=function(e){var n=i(this),c=e.find("."+t);c.on("click",function(i){e.hasClass(a+"ed")?e.removeClass(a+"ed"):(r(i,!0),e.addClass(a+"ed"))}),e.find("dl>dd").on("click",function(){var e=i(this),a=e.attr("lay-value"),t=n.attr("lay-filter");n.val(a).removeClass("layui-form-danger"),c.find("input").val(e.text()),e.addClass(s).siblings().removeClass(s),layui.event(l,"select("+t+")",{elem:n[0],value:a})}),e.find("dl>dt").on("click",function(e){layui.stope(e)}),i(document).off("click",r).on("click",r)};n.each(function(n,l){var c=i(this),r=c.next("."+a),u=l.value,d=i(l.options[l.selectedIndex]),f=i(['<div class="layui-unselect '+a+'">','<div class="'+t+'"><input type="text" placeholder="'+(l.options[0].innerHTML?l.options[0].innerHTML:e)+'" value="'+(u?d.html():"")+'" readonly class="layui-input layui-unselect">','<i class="layui-edge"></i></div>','<dl class="layui-anim layui-anim-upbit'+(c.find("optgroup")[0]?" layui-select-group":"")+'">'+function(e){var i=[];return layui.each(e,function(e,a){(0!==e||a.value)&&("optgroup"===a.tagName.toLowerCase()?i.push("<dt>"+a.label+"</dt>"):i.push('<dd lay-value="'+a.value+'" '+(u===a.value?'class="'+s+'"':"")+">"+a.innerHTML+"</dd>"))}),i.join("")}(c.find("*"))+"</dl>","</div>"].join(""));r[0]&&r.remove(),c.after(f),o.call(this,f)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},a=i(c).find("input[type=checkbox]"),t=function(e,a){var t=i(this);e.on("click",function(){var i=t.attr("lay-filter");t[0].checked?(t[0].checked=!1,e.removeClass(a[1])):(t[0].checked=!0,e.addClass(a[1])),layui.event(l,a[2]+"("+i+")",{elem:t[0],value:t[0].value})})};a.each(function(a,n){var l=i(this),c=l.attr("lay-skin");"switch"===c&&(c="_"+c);var s=e[c]||e.checkbox,r=l.next("."+s[0]),o=i(['<div class="layui-unselect '+s[0]+(n.checked?" "+s[1]:"")+'">',{_switch:"<i></i>"}[c]||"<span>"+(n.title||"勾选")+'</span><i class="layui-icon">&#xe618;</i>',"</div>"].join(""));r[0]&&r.remove(),l.after(o),t.call(this,o,s)})},radio:function(){var e="layui-form-radio",a=["&#xe643;","&#xe63f;"],t=i(c).find("input[type=radio]"),n=function(t){var n=i(this),s="layui-anim-scaleSpring";t.on("click",function(){var r=n[0].name,o=n.parents(c),u=n.attr("lay-filter"),d=o.find("input[name="+r+"]");layui.each(d,function(){var t=i(this).next("."+e);this.checked=!1,t.removeClass(e+"ed"),t.find(".layui-icon").removeClass(s).html(a[1])}),n[0].checked=!0,t.addClass(e+"ed"),t.find(".layui-icon").addClass(s).html(a[0]),layui.event(l,"radio("+u+")",{elem:n[0],value:n[0].value})})};t.each(function(t,l){var c=i(this),s=c.next("."+e),r=i(['<div class="layui-unselect '+e+(l.checked?" "+e+"ed":"")+'">','<i class="layui-anim layui-icon">'+a[l.checked?0:1]+"</i>","<span>"+(l.title||"未命名")+"</span>","</div>"].join(""));s[0]&&s.remove(),c.after(r),n.call(this,r)})}};return e?n[e]?n[e]():t.error("不支持的"+e+"表单渲染"):layui.each(n,function(e,i){i()}),a};var o=function(){var e=i(this),t=u.config.verify,s=null,r="layui-form-danger",o={},d=e.parents(c),f=d.find("*[lay-verify]"),y=e.parents("form")[0],v=d.find("input,select,textarea"),h=e.attr("lay-filter");return layui.each(f,function(e,l){var c=i(this),o=c.attr("lay-verify"),u="",d=c.val(),f="function"==typeof t[o];if(c.removeClass(r),t[o]&&(f?u=t[o](d,l):!t[o][0].test(d)))return a.msg(u||t[o][1],{icon:5,shift:6}),n.android||n.ios||l.focus(),c.addClass(r),s=!0}),!s&&(layui.each(v,function(e,i){i.name&&(/^checkbox|radio$/.test(i.type)&&!i.checked||(o[i.name]=i.value))}),layui.event.call(this,l,"submit("+h+")",{elem:this,form:y,field:o}))},u=new r,d=i(document);u.render(),d.on("reset",c,function(){setTimeout(function(){u.render()},50)}),d.on("submit",c,o).on("click","*[lay-submit]",o),e(l,function(e){return u.set(e)})});

View File

@ -118,7 +118,7 @@ layui.define('jquery', function(exports){
call.tabAuto.call({});
//Tab切换
body.off('click', TITLE, call.tabClick)
dom.off('click', TITLE, call.tabClick)
.on('click', TITLE, call.tabClick);
//自适应
@ -126,7 +126,7 @@ layui.define('jquery', function(exports){
.on('resize', call.tabAuto);
//隐藏展开的Tab
$(document).off('click', call.hideTabMore)
dom.off('click', call.hideTabMore)
.on('click', call.hideTabMore);
}
//导航菜单
@ -248,7 +248,7 @@ layui.define('jquery', function(exports){
};
var element = new Element(), body = $('body');
var element = new Element(), dom = $(document);
element.init();
exports(MOD_NAME, function(options){

View File

@ -291,18 +291,18 @@ layui.define('layer', function(exports){
};
//自动完成渲染
var form = new Form(), body = $('body');
var form = new Form(), dom = $(document);
form.render();
//表单reset重置渲染
body.on('reset', ELEM, function(){
dom.on('reset', ELEM, function(){
setTimeout(function(){
form.render();
}, 50);
});
//表单提交事件
body.on('submit', ELEM, submit)
dom.on('submit', ELEM, submit)
.on('click', '*[lay-submit]', submit);
exports(MOD_NAME, function(options){