From 95f08f1f8be76fa9ce53f0bb4512f79e55607872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Tue, 2 Aug 2022 17:20:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20layTable=20=E5=8F=8C?= =?UTF-8?q?=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在按钮上加 data-event-dbclick 时,双击 tr 时会触发 click 事件或指定事件。 --- app/admin/view/menu/index.html | 2 +- public/static/admin.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/admin/view/menu/index.html b/app/admin/view/menu/index.html index 32199b458..8b2c8e850 100644 --- a/app/admin/view/menu/index.html +++ b/app/admin/view/menu/index.html @@ -107,7 +107,7 @@ {{# } }} {if auth('edit')} - 编 辑 + 编 辑 {/if} {if auth('remove')} diff --git a/public/static/admin.js b/public/static/admin.js index b972c4bfb..4c219e09c 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -769,6 +769,10 @@ $(function () { $table.trigger('render', {height: $(window).height() - $table.next().offset().top - 35}) }).trigger('sort', function (rets) { (sort = rets), $table.trigger('reload') + }).trigger('rowDouble', function (event) { + $(event.tr[0]).find('[data-event-dbclick]').map(function () { + $(this).trigger(this.dataset.eventDbclick || 'click', event); + }); }); return $table;