prosemirror-dropcursor
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -0,1 +1,7 @@ | ||
## 1.3.3 (2021-02-04) | ||
### Bug fixes | ||
Fix drop cursor positioning when the editor's `offsetParent` has been scrolled. | ||
## 1.3.2 (2019-11-20) | ||
@@ -2,0 +8,0 @@ |
@@ -94,6 +94,13 @@ import { Plugin } from 'prosemirror-state'; | ||
} | ||
var parentRect = !parent || parent == document.body && getComputedStyle(parent).position == "static" | ||
? {left: -pageXOffset, top: -pageYOffset} : parent.getBoundingClientRect(); | ||
this.element.style.left = (rect.left - parentRect.left) + "px"; | ||
this.element.style.top = (rect.top - parentRect.top) + "px"; | ||
var parentLeft, parentTop; | ||
if (!parent || parent == document.body && getComputedStyle(parent).position == "static") { | ||
parentLeft = -pageXOffset; | ||
parentTop = -pageYOffset; | ||
} else { | ||
var rect$1 = parent.getBoundingClientRect(); | ||
parentLeft = rect$1.left - parent.scrollLeft; | ||
parentTop = rect$1.top - parent.scrollTop; | ||
} | ||
this.element.style.left = (rect.left - parentLeft) + "px"; | ||
this.element.style.top = (rect.top - parentTop) + "px"; | ||
this.element.style.width = (rect.right - rect.left) + "px"; | ||
@@ -100,0 +107,0 @@ this.element.style.height = (rect.bottom - rect.top) + "px"; |
@@ -98,6 +98,13 @@ 'use strict'; | ||
} | ||
var parentRect = !parent || parent == document.body && getComputedStyle(parent).position == "static" | ||
? {left: -pageXOffset, top: -pageYOffset} : parent.getBoundingClientRect(); | ||
this.element.style.left = (rect.left - parentRect.left) + "px"; | ||
this.element.style.top = (rect.top - parentRect.top) + "px"; | ||
var parentLeft, parentTop; | ||
if (!parent || parent == document.body && getComputedStyle(parent).position == "static") { | ||
parentLeft = -pageXOffset; | ||
parentTop = -pageYOffset; | ||
} else { | ||
var rect$1 = parent.getBoundingClientRect(); | ||
parentLeft = rect$1.left - parent.scrollLeft; | ||
parentTop = rect$1.top - parent.scrollTop; | ||
} | ||
this.element.style.left = (rect.left - parentLeft) + "px"; | ||
this.element.style.top = (rect.top - parentTop) + "px"; | ||
this.element.style.width = (rect.right - rect.left) + "px"; | ||
@@ -104,0 +111,0 @@ this.element.style.height = (rect.bottom - rect.top) + "px"; |
{ | ||
"name": "prosemirror-dropcursor", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Drop cursor plugin for ProseMirror", | ||
@@ -20,4 +20,4 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"rollup": "^1.26.3", | ||
"@rollup/plugin-buble": "^0.20.0" | ||
"rollup": "^2.26.3", | ||
"@rollup/plugin-buble": "^0.21.3" | ||
}, | ||
@@ -24,0 +24,0 @@ "dependencies": { |
# prosemirror-dropcursor | ||
[ [**WEBSITE**](http://prosemirror.net) | [**ISSUES**](https://github.com/prosemirror/prosemirror-dropcursor/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**GITTER**](https://gitter.im/ProseMirror/prosemirror) ] | ||
[ [**WEBSITE**](https://prosemirror.net) | [**ISSUES**](https://github.com/prosemirror/prosemirror-dropcursor/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**GITTER**](https://gitter.im/ProseMirror/prosemirror) | [**CHANGELOG**](https://github.com/ProseMirror/prosemirror-dropcursor/blob/master/CHANGELOG.md) ] | ||
This is a non-core example module for [ProseMirror](http://prosemirror.net). | ||
This is a non-core example module for [ProseMirror](https://prosemirror.net). | ||
ProseMirror is a well-behaved rich semantic content editor based on | ||
@@ -13,5 +13,5 @@ contentEditable, with support for collaborative editing and custom | ||
The [project page](http://prosemirror.net) has more information, a | ||
number of [examples](http://prosemirror.net/examples/) and the | ||
[documentation](http://prosemirror.net/docs/). | ||
The [project page](https://prosemirror.net) has more information, a | ||
number of [examples](https://prosemirror.net/examples/) and the | ||
[documentation](https://prosemirror.net/docs/). | ||
@@ -18,0 +18,0 @@ This code is released under an |
@@ -13,3 +13,3 @@ module.exports = { | ||
plugins: [require('@rollup/plugin-buble')()], | ||
external(id) { return !/^[\.\/]/.test(id) } | ||
external(id) { return id[0] != "." && !require("path").isAbsolute(id) } | ||
} |
@@ -84,6 +84,13 @@ import {Plugin} from "prosemirror-state" | ||
} | ||
let parentRect = !parent || parent == document.body && getComputedStyle(parent).position == "static" | ||
? {left: -pageXOffset, top: -pageYOffset} : parent.getBoundingClientRect() | ||
this.element.style.left = (rect.left - parentRect.left) + "px" | ||
this.element.style.top = (rect.top - parentRect.top) + "px" | ||
let parentLeft, parentTop | ||
if (!parent || parent == document.body && getComputedStyle(parent).position == "static") { | ||
parentLeft = -pageXOffset | ||
parentTop = -pageYOffset | ||
} else { | ||
let rect = parent.getBoundingClientRect() | ||
parentLeft = rect.left - parent.scrollLeft | ||
parentTop = rect.top - parent.scrollTop | ||
} | ||
this.element.style.left = (rect.left - parentLeft) + "px" | ||
this.element.style.top = (rect.top - parentTop) + "px" | ||
this.element.style.width = (rect.right - rect.left) + "px" | ||
@@ -90,0 +97,0 @@ this.element.style.height = (rect.bottom - rect.top) + "px" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43396
383