From 2d9b37f52f9464177cf7f307751c601a80ade0e3 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:29:47 +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 --- application/admin/view/login.index.html | 2 +- public/static/admin/app.js | 6 +----- public/static/admin/plugs.js | 17 +++++++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/application/admin/view/login.index.html b/application/admin/view/login.index.html index b8a9ff4bf..a39f44f01 100644 --- a/application/admin/view/login.index.html +++ b/application/admin/view/login.index.html @@ -65,7 +65,7 @@ placeholder="请输入密码"/>
  • - + 忘记密码?
  • diff --git a/public/static/admin/app.js b/public/static/admin/app.js index a3ad39904..dac2d73e2 100644 --- a/public/static/admin/app.js +++ b/public/static/admin/app.js @@ -75,10 +75,6 @@ require(['pace', 'jquery', 'layui', 'laydate', 'bootstrap', 'template', 'ueditor layui.use(['layer', 'form', 'element'], function () { window.layer = layui.layer; window.form = layui.form(); - require(['admin.listen'], function () { - $('[data-loaded]').map(function () { - $(this).html($(this).attr('data-loaded')).removeClass('layui-disabled'); - }); - }); + require(['admin.listen']); }); }); diff --git a/public/static/admin/plugs.js b/public/static/admin/plugs.js index fec26d1fb..f4fe7612f 100644 --- a/public/static/admin/plugs.js +++ b/public/static/admin/plugs.js @@ -167,8 +167,8 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { msg.prototype.loading = function (msg, callback) { this.close(); return this.index = msg - ? layer.msg(msg, {icon: 16, scrollbar: false, shade: this.shade, time: 0, end: callback}) - : layer.load(2, {time: 0, scrollbar: false, shade: this.shade, end: callback}); + ? layer.msg(msg, {icon: 16, scrollbar: false, shade: this.shade, time: 0, end: callback}) + : layer.load(2, {time: 0, scrollbar: false, shade: this.shade, end: callback}); }; /** @@ -756,6 +756,7 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { * 自动监听规则内表单 */ $.validate.listen = function () { + $('form[data-auto]').map(function () { if ($(this).attr('data-listen') === 'true') { return; @@ -763,12 +764,16 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) { var callback = $(this).attr('data-callback'); $(this).attr('data-listen', "true").validate(function (data) { $.form.load(this.getAttribute('action') || window.location.href, data, - this.getAttribute('method') || 'POST', - window[callback || '_default_callback'] || undefined, true, - this.getAttribute('data-tips') || undefined, - this.getAttribute('data-time') || undefined); + this.getAttribute('method') || 'POST', + window[callback || '_default_callback'] || undefined, true, + 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'); + }); }; /**