Remove a couple of unused options from the GrabToPan
constructor
These options are completely unused in the PDF.js viewer, and given that the last update of the `GrabToPan`-code from upstream was in 2016 it shouldn't hurt to remove them.
This commit is contained in:
parent
d329267926
commit
f373fcb356
@ -21,18 +21,10 @@ class GrabToPan {
|
|||||||
/**
|
/**
|
||||||
* Construct a GrabToPan instance for a given HTML element.
|
* Construct a GrabToPan instance for a given HTML element.
|
||||||
* @param {Element} options.element
|
* @param {Element} options.element
|
||||||
* @param {function} [options.ignoreTarget] - See `ignoreTarget(node)`.
|
|
||||||
* @param {function(boolean)} [options.onActiveChanged] - Called when
|
|
||||||
* grab-to-pan is (de)activated. The first argument is a boolean that
|
|
||||||
* shows whether grab-to-pan is activated.
|
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor({ element }) {
|
||||||
this.element = options.element;
|
this.element = element;
|
||||||
this.document = options.element.ownerDocument;
|
this.document = element.ownerDocument;
|
||||||
if (typeof options.ignoreTarget === "function") {
|
|
||||||
this.ignoreTarget = options.ignoreTarget;
|
|
||||||
}
|
|
||||||
this.onActiveChanged = options.onActiveChanged;
|
|
||||||
|
|
||||||
// Bind the contexts to ensure that `this` always points to
|
// Bind the contexts to ensure that `this` always points to
|
||||||
// the GrabToPan instance.
|
// the GrabToPan instance.
|
||||||
@ -57,8 +49,6 @@ class GrabToPan {
|
|||||||
this.active = true;
|
this.active = true;
|
||||||
this.element.addEventListener("mousedown", this._onMouseDown, true);
|
this.element.addEventListener("mousedown", this._onMouseDown, true);
|
||||||
this.element.classList.add(CSS_CLASS_GRAB);
|
this.element.classList.add(CSS_CLASS_GRAB);
|
||||||
|
|
||||||
this.onActiveChanged?.(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,8 +61,6 @@ class GrabToPan {
|
|||||||
this.element.removeEventListener("mousedown", this._onMouseDown, true);
|
this.element.removeEventListener("mousedown", this._onMouseDown, true);
|
||||||
this._endPan();
|
this._endPan();
|
||||||
this.element.classList.remove(CSS_CLASS_GRAB);
|
this.element.classList.remove(CSS_CLASS_GRAB);
|
||||||
|
|
||||||
this.onActiveChanged?.(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user