From ed784c624a414a2aea60ec021f38e0dee4de510d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 5 Apr 2017 14:39:44 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E8=B0=83=E6=95=B4=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=88=9D=E5=A7=8B=E5=8C=96=20data-form-loaded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/plugs.js | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/public/static/admin/plugs.js b/public/static/admin/plugs.js index f4fe7612f..9d889b397 100644 --- a/public/static/admin/plugs.js +++ b/public/static/admin/plugs.js @@ -10,7 +10,7 @@ // | github开源项目:https://github.com/zoujingli/Think.Admin // +---------------------------------------------------------------------- -define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { +define(['jquery'], function () { /*! * jQuery placeholder, fix for IE6,7,8,9 @@ -283,17 +283,6 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { */ _form.prototype.reInit = function ($container) { $.validate.listen.call(this); - $('[data-copy]').map(function () { - var client = new ZeroClipboard(this); - client.on("ready", function () { - client.on("copy", function (event) { - event.clipboardData.setData("text/plain", event.target.getAttribute('data-copy')); - }); - client.on("aftercopy", function () { - $.msg.tips('内容复制成功!'); - }); - }); - }); JPlaceHolder.init(); /* 自动给必填字符加上样式 @zoujingli @by 2016-05-11 */ $container.find('[required]').parent().prevAll('label').addClass('label-required'); @@ -756,7 +745,6 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { * 自动监听规则内表单 */ $.validate.listen = function () { - $('form[data-auto]').map(function () { if ($(this).attr('data-listen') === 'true') { return; @@ -769,19 +757,16 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { this.getAttribute('data-tips') || undefined, this.getAttribute('data-time') || undefined); }); - }); - $('[data-form-loaded]').map(function () { - $(this).html(this.getAttribute('data-form-loaded') || this.innerHTML); - $(this).removeAttr('data-form-loaded').removeClass('layui-disabled'); + $(this).find('[data-form-loaded]').map(function () { + $(this).html(this.getAttribute('data-form-loaded') || this.innerHTML); + $(this).removeAttr('data-form-loaded').removeClass('layui-disabled'); + }); }); }; /** * 表单监听初始化 */ - if ($.form && typeof $.form.load === 'function') { - $.validate.listen.call(this); - } - return $; + ($.form && typeof $.form.load === 'function') && $.validate.listen.call(this); }); \ No newline at end of file