From fe4465bbbaf986c9110649611f00dcc4cb9e2882 Mon Sep 17 00:00:00 2001 From: Karson Date: Fri, 28 Apr 2017 00:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E8=BF=87=E9=95=BF=E5=8F=AF=E8=83=BD=E5=AF=BC=E8=87=B4=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=8F=90=E7=A4=BA=E6=A1=86=E8=A2=AB=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E7=9A=84BUG=20=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA=E6=A1=86=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/require-table.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index d91dffe6..592b8eb4 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -228,9 +228,17 @@ define(['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment', 'bootstr }, 'click .btn-delone': function (e, value, row, index) { var that = this; + var top = $(that).offset().top - $(window).scrollTop(); + var left = $(that).offset().left - $(window).scrollLeft() - 260; + if(top + 154 > $(window).height()){ + top = top - 154; + } + if($(window).width()<480){ + top = left = undefined; + } var index = Backend.api.layer.confirm( __('Are you sure you want to delete this item?'), - {icon: 3, title: __('Warning'), offset: [$(that).offset().top, $(that).offset().left - 260], shadeClose: true}, + {icon: 3, title: __('Warning'), offset: [top, left], shadeClose: true}, function () { var table = $(that).closest('table'); Table.api.multi("del", row.id, table, that);