MCPcopy Create free account
hub / github.com/TruthHun/BookStack / mousemove

Function mousemove

static/wangEditor/js/wangEditor.js:7933–7955  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

7931 var imgWidth, imgHeight;
7932
7933 function mousemove (e) {
7934 var diffX, diffY;
7935
7936 // 计算差额
7937 diffX = e.pageX - _x;
7938 diffY = e.pageY - _y;
7939
7940 // --------- 计算拖拽点的位置 ---------
7941 var currentDragMarginLeft = dragMarginLeft + diffX;
7942 var currentDragMarginTop = dragMarginTop + diffY;
7943 $dragPoint.css({
7944 'margin-left': currentDragMarginLeft,
7945 'margin-top': currentDragMarginTop
7946 });
7947
7948 // --------- 计算图片的大小 ---------
7949 var currentImgWidth = imgWidth + diffX;
7950 var currentImggHeight = imgHeight + diffY;
7951 $currentImg && $currentImg.css({
7952 width: currentImgWidth,
7953 height: currentImggHeight
7954 });
7955 }
7956
7957 $dragPoint.on('mousedown', function(e){
7958 if (!$currentImg) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected