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

Function moveAction

static/editor.md/editormd.amd.js:4452–4485  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

4450 };
4451
4452 var moveAction = function (e) {
4453 e = e || window.event; //IE
4454
4455 var left, top, nowLeft = parseInt(dialog[0].style.left), nowTop = parseInt(dialog[0].style.top);
4456
4457 if( nowLeft >= 0 ) {
4458 if( nowLeft + dialog.width() <= $(window).width()) {
4459 left = e.clientX - posX;
4460 } else {
4461 left = $(window).width() - dialog.width();
4462 document.onmousemove = null;
4463 }
4464 } else {
4465 left = 0;
4466 document.onmousemove = null;
4467 }
4468
4469 if( nowTop >= 0 ) {
4470 top = e.clientY - posY;
4471 } else {
4472 top = 0;
4473 document.onmousemove = null;
4474 }
4475
4476
4477 document.onselectstart = function() {
4478 return false;
4479 };
4480
4481 userUnselect($("body"));
4482 userUnselect(dialog);
4483 dialog[0].style.left = left + "px";
4484 dialog[0].style.top = top + "px";
4485 };
4486
4487 document.onmouseup = function() {
4488 userCanSelect($("body"));

Callers

nothing calls this directly

Calls 2

userUnselectFunction · 0.70
$Function · 0.50

Tested by

no test coverage detected