From 0d9a38a8a44153a074243b71f8f6ff88c218510f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 9 Jul 2019 17:52:40 +0800 Subject: [PATCH] drag --- public/react/public/js/js_min_all.js | 27 +++++++++++++++++--- public/react/src/modules/page/MainContent.js | 10 +++++++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/public/react/public/js/js_min_all.js b/public/react/public/js/js_min_all.js index 79134fc55..0d7a8988e 100755 --- a/public/react/public/js/js_min_all.js +++ b/public/react/public/js/js_min_all.js @@ -211,20 +211,35 @@ $(function(){ var FF = !(window.mozInnerScreenX == null); var websshLineHeight = FF ? 19 : 18 - + function throttle(method, delay, duration){ + var timer = null, begin = new Date(); + return function(){ + var context = this, args = arguments, current = new Date(); + clearTimeout(timer); + if(current-begin >= duration){ + method.apply(context, args); + begin = current; + } else { + timer = setTimeout(function(){ + method.apply(context, args); + }, delay); + } + } + } doc.live('mousemove touchmove',function(e){ $(".-brother").show();// 代码行的遮罩显示 if(dragging) { clickX = e.pageX || e.originalEvent.touches[0].pageX;; if(clickX > leftOffset+0&&clickX