@lumino/dragdrop
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -198,2 +198,15 @@ import { DisposableDelegate } from '@lumino/disposable'; | ||
/** | ||
* Move the drag image element to the specified location. | ||
* | ||
* This is a no-op if there is no drag image element. | ||
*/ | ||
Drag.prototype.moveDragImage = function (clientX, clientY) { | ||
if (!this.dragImage) { | ||
return; | ||
} | ||
var style = this.dragImage.style; | ||
style.top = clientY + "px"; | ||
style.left = clientX + "px"; | ||
}; | ||
/** | ||
* Handle the `'mousemove'` event for the drag object. | ||
@@ -211,3 +224,3 @@ */ | ||
// performed *after* dispatching to prevent unnecessary reflows. | ||
this._moveDragImage(event.clientX, event.clientY); | ||
this.moveDragImage(event.clientX, event.clientY); | ||
}; | ||
@@ -362,15 +375,2 @@ /** | ||
/** | ||
* Move the drag image element to the specified location. | ||
* | ||
* This is a no-op if there is no drag image element. | ||
*/ | ||
Drag.prototype._moveDragImage = function (clientX, clientY) { | ||
if (!this.dragImage) { | ||
return; | ||
} | ||
var style = this.dragImage.style; | ||
style.top = clientY + "px"; | ||
style.left = clientX + "px"; | ||
}; | ||
/** | ||
* Detach the drag image element from the DOM. | ||
@@ -377,0 +377,0 @@ * |
@@ -202,2 +202,15 @@ (function (global, factory) { | ||
/** | ||
* Move the drag image element to the specified location. | ||
* | ||
* This is a no-op if there is no drag image element. | ||
*/ | ||
Drag.prototype.moveDragImage = function (clientX, clientY) { | ||
if (!this.dragImage) { | ||
return; | ||
} | ||
var style = this.dragImage.style; | ||
style.top = clientY + "px"; | ||
style.left = clientX + "px"; | ||
}; | ||
/** | ||
* Handle the `'mousemove'` event for the drag object. | ||
@@ -215,3 +228,3 @@ */ | ||
// performed *after* dispatching to prevent unnecessary reflows. | ||
this._moveDragImage(event.clientX, event.clientY); | ||
this.moveDragImage(event.clientX, event.clientY); | ||
}; | ||
@@ -366,15 +379,2 @@ /** | ||
/** | ||
* Move the drag image element to the specified location. | ||
* | ||
* This is a no-op if there is no drag image element. | ||
*/ | ||
Drag.prototype._moveDragImage = function (clientX, clientY) { | ||
if (!this.dragImage) { | ||
return; | ||
} | ||
var style = this.dragImage.style; | ||
style.top = clientY + "px"; | ||
style.left = clientX + "px"; | ||
}; | ||
/** | ||
* Detach the drag image element from the DOM. | ||
@@ -381,0 +381,0 @@ * |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@lumino/disposable")):"function"==typeof define&&define.amd?define(["exports","@lumino/disposable"],t):t((e=e||self).lumino_dragdrop={},e.lumino_disposable)}(this,(function(e,t){"use strict";var o;e.Drag=function(){function e(e){var t=this;this._onScrollFrame=function(){if(t._scrollTarget){var e=t._scrollTarget,r=e.element,n=e.edge,i=e.distance,s=o.SCROLL_EDGE_SIZE-i,a=Math.pow(s/o.SCROLL_EDGE_SIZE,2),d=Math.max(1,Math.round(a*o.SCROLL_EDGE_SIZE));switch(n){case"top":r.scrollTop-=d;break;case"left":r.scrollLeft-=d;break;case"right":r.scrollLeft+=d;break;case"bottom":r.scrollTop+=d}requestAnimationFrame(t._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}return e.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var e=o.createMouseEvent("mouseup",-1,-1);o.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}},Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.start=function(e,t){var r=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise((function(e,t){r._resolve=e}));var n=o.createMouseEvent("mousemove",e,t);return document.dispatchEvent(n),this._promise},e.prototype.handleEvent=function(e){switch(e.type){case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}},e.prototype._evtMouseMove=function(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this._moveDragImage(e.clientX,e.clientY)},e.prototype._evtMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),0===e.button)if(this._updateCurrentTarget(e),this._currentTarget){if("none"===this._dropAction)return o.dispatchDragLeave(this,this._currentTarget,null,e),void this._finalize("none");var t=o.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}else this._finalize("none")},e.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()},e.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},e.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},e.prototype._updateDragScroll=function(e){var t=o.findScrollTarget(e);(this._scrollTarget||t)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)},e.prototype._updateCurrentTarget=function(e){var t=this._currentTarget,r=this._currentTarget,n=this._currentElement,i=document.elementFromPoint(e.clientX,e.clientY);this._currentElement=i,i!==n&&i!==r&&o.dispatchDragExit(this,r,i,e),i!==n&&i!==r&&(r=o.dispatchDragEnter(this,i,r,e)),r!==t&&(this._currentTarget=r,o.dispatchDragLeave(this,t,r,e));var s=o.dispatchDragOver(this,r,e);this._setDropAction(s)},e.prototype._attachDragImage=function(e,t){if(this.dragImage){this.dragImage.classList.add("lm-mod-drag-image"),this.dragImage.classList.add("p-mod-drag-image");var o=this.dragImage.style;o.pointerEvents="none",o.position="fixed",o.top=t+"px",o.left=e+"px",document.body.appendChild(this.dragImage)}},e.prototype._moveDragImage=function(e,t){if(this.dragImage){var o=this.dragImage.style;o.top=t+"px",o.left=e+"px"}},e.prototype._detachDragImage=function(){if(this.dragImage){var e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}},e.prototype._setDropAction=function(t){if(t=o.validateAction(t,this.supportedActions),!this._override||this._dropAction!==t)switch(t){case"none":this._dropAction=t,this._override=e.overrideCursor("no-drop");break;case"copy":this._dropAction=t,this._override=e.overrideCursor("copy");break;case"link":this._dropAction=t,this._override=e.overrideCursor("alias");break;case"move":this._dropAction=t,this._override=e.overrideCursor("move")}},e.prototype._finalize=function(e){var t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)},e}(),function(e){e.overrideCursor=function(e){var r=++o;return document.body.style.cursor=e,document.body.classList.add("lm-mod-override-cursor"),document.body.classList.add("p-mod-override-cursor"),new t.DisposableDelegate((function(){r===o&&(document.body.style.cursor="",document.body.classList.remove("lm-mod-override-cursor"),document.body.classList.remove("p-mod-override-cursor"))}))};var o=0}(e.Drag||(e.Drag={})),function(e){e.SCROLL_EDGE_SIZE=20,e.validateAction=function(e,r){return t[e]&o[r]?e:"none"},e.createMouseEvent=function(e,t,o){var r=document.createEvent("MouseEvent");return r.initMouseEvent(e,!0,!0,window,0,0,0,t,o,!1,!1,!1,!1,0,null),r},e.findScrollTarget=function(t){for(var o=t.clientX,r=t.clientY,n=document.elementFromPoint(o,r);n;n=n.parentElement){var i=n.hasAttribute("data-lm-dragscroll");if(i=i||n.hasAttribute("data-p-dragscroll")){var s=0,a=0;n===document.body&&(s=window.pageXOffset,a=window.pageYOffset);var d=n.getBoundingClientRect(),c=d.top+a,u=d.left+s,l=u+d.width,p=c+d.height;if(!(o<u||o>=l||r<c||r>=p)){var h=o-u+1,m=r-c+1,v=l-o,g=p-r,f=Math.min(h,m,v,g);if(!(f>e.SCROLL_EDGE_SIZE)){var _=void 0;switch(f){case g:_="bottom";break;case m:_="top";break;case v:_="right";break;case h:_="left";break;default:throw"unreachable"}var E=n.scrollWidth-n.clientWidth,y=n.scrollHeight-n.clientHeight,L=void 0;switch(_){case"top":L=y>0&&n.scrollTop>0;break;case"left":L=E>0&&n.scrollLeft>0;break;case"right":L=E>0&&n.scrollLeft<E;break;case"bottom":L=y>0&&n.scrollTop<y;break;default:throw"unreachable"}if(L)return{element:n,edge:_,distance:f}}}}}return null},e.dispatchDragEnter=function(e,t,o,n){if(!t)return null;var i=r("lm-dragenter",e,n,o),s=!t.dispatchEvent(i);return s?t:(i=r("p-dragenter",e,n,o),(s=!t.dispatchEvent(i))?t:t===document.body?o:(i=r("lm-dragenter",e,n,o),document.body.dispatchEvent(i),i=r("p-dragenter",e,n,o),document.body.dispatchEvent(i),document.body))},e.dispatchDragExit=function(e,t,o,n){if(t){var i=r("lm-dragexit",e,n,o);t.dispatchEvent(i),i=r("p-dragexit",e,n,o),t.dispatchEvent(i)}},e.dispatchDragLeave=function(e,t,o,n){if(t){var i=r("lm-dragleave",e,n,o);t.dispatchEvent(i),i=r("p-dragleave",e,n,o),t.dispatchEvent(i)}},e.dispatchDragOver=function(e,t,o){if(!t)return"none";var n=r("lm-dragover",e,o,null),i=!t.dispatchEvent(n);return i?n.dropAction:(n=r("p-dragover",e,o,null),(i=!t.dispatchEvent(n))?n.dropAction:"none")},e.dispatchDrop=function(e,t,o){if(!t)return"none";var n=r("lm-drop",e,o,null),i=!t.dispatchEvent(n);return i?n.dropAction:(n=r("p-drop",e,o,null),(i=!t.dispatchEvent(n))?n.dropAction:"none")};var t={none:0,copy:1,link:2,move:4},o={none:t.none,copy:t.copy,link:t.link,move:t.move,"copy-link":t.copy|t.link,"copy-move":t.copy|t.move,"link-move":t.link|t.move,all:t.copy|t.link|t.move};function r(e,t,o,r){var n=document.createEvent("MouseEvent");return n.initMouseEvent(e,!0,!0,window,0,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,r),n.dropAction="none",n.mimeData=t.mimeData,n.proposedAction=t.proposedAction,n.supportedActions=t.supportedActions,n.source=t.source,n}}(o||(o={})),Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@lumino/disposable")):"function"==typeof define&&define.amd?define(["exports","@lumino/disposable"],t):t((e=e||self).lumino_dragdrop={},e.lumino_disposable)}(this,(function(e,t){"use strict";var o;e.Drag=function(){function e(e){var t=this;this._onScrollFrame=function(){if(t._scrollTarget){var e=t._scrollTarget,r=e.element,n=e.edge,i=e.distance,s=o.SCROLL_EDGE_SIZE-i,a=Math.pow(s/o.SCROLL_EDGE_SIZE,2),d=Math.max(1,Math.round(a*o.SCROLL_EDGE_SIZE));switch(n){case"top":r.scrollTop-=d;break;case"left":r.scrollLeft-=d;break;case"right":r.scrollLeft+=d;break;case"bottom":r.scrollTop+=d}requestAnimationFrame(t._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.mimeData=e.mimeData,this.dragImage=e.dragImage||null,this.proposedAction=e.proposedAction||"copy",this.supportedActions=e.supportedActions||"all",this.source=e.source||null}return e.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var e=o.createMouseEvent("mouseup",-1,-1);o.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}},Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),e.prototype.start=function(e,t){var r=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(e,t),this._promise=new Promise((function(e,t){r._resolve=e}));var n=o.createMouseEvent("mousemove",e,t);return document.dispatchEvent(n),this._promise},e.prototype.handleEvent=function(e){switch(e.type){case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault(),e.stopPropagation()}},e.prototype.moveDragImage=function(e,t){if(this.dragImage){var o=this.dragImage.style;o.top=t+"px",o.left=e+"px"}},e.prototype._evtMouseMove=function(e){e.preventDefault(),e.stopPropagation(),this._updateCurrentTarget(e),this._updateDragScroll(e),this.moveDragImage(e.clientX,e.clientY)},e.prototype._evtMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),0===e.button)if(this._updateCurrentTarget(e),this._currentTarget){if("none"===this._dropAction)return o.dispatchDragLeave(this,this._currentTarget,null,e),void this._finalize("none");var t=o.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}else this._finalize("none")},e.prototype._evtKeyDown=function(e){e.preventDefault(),e.stopPropagation(),27===e.keyCode&&this.dispose()},e.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},e.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},e.prototype._updateDragScroll=function(e){var t=o.findScrollTarget(e);(this._scrollTarget||t)&&(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=t)},e.prototype._updateCurrentTarget=function(e){var t=this._currentTarget,r=this._currentTarget,n=this._currentElement,i=document.elementFromPoint(e.clientX,e.clientY);this._currentElement=i,i!==n&&i!==r&&o.dispatchDragExit(this,r,i,e),i!==n&&i!==r&&(r=o.dispatchDragEnter(this,i,r,e)),r!==t&&(this._currentTarget=r,o.dispatchDragLeave(this,t,r,e));var s=o.dispatchDragOver(this,r,e);this._setDropAction(s)},e.prototype._attachDragImage=function(e,t){if(this.dragImage){this.dragImage.classList.add("lm-mod-drag-image"),this.dragImage.classList.add("p-mod-drag-image");var o=this.dragImage.style;o.pointerEvents="none",o.position="fixed",o.top=t+"px",o.left=e+"px",document.body.appendChild(this.dragImage)}},e.prototype._detachDragImage=function(){if(this.dragImage){var e=this.dragImage.parentNode;e&&e.removeChild(this.dragImage)}},e.prototype._setDropAction=function(t){if(t=o.validateAction(t,this.supportedActions),!this._override||this._dropAction!==t)switch(t){case"none":this._dropAction=t,this._override=e.overrideCursor("no-drop");break;case"copy":this._dropAction=t,this._override=e.overrideCursor("copy");break;case"link":this._dropAction=t,this._override=e.overrideCursor("alias");break;case"move":this._dropAction=t,this._override=e.overrideCursor("move")}},e.prototype._finalize=function(e){var t=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,t&&t(e)},e}(),function(e){e.overrideCursor=function(e){var r=++o;return document.body.style.cursor=e,document.body.classList.add("lm-mod-override-cursor"),document.body.classList.add("p-mod-override-cursor"),new t.DisposableDelegate((function(){r===o&&(document.body.style.cursor="",document.body.classList.remove("lm-mod-override-cursor"),document.body.classList.remove("p-mod-override-cursor"))}))};var o=0}(e.Drag||(e.Drag={})),function(e){e.SCROLL_EDGE_SIZE=20,e.validateAction=function(e,r){return t[e]&o[r]?e:"none"},e.createMouseEvent=function(e,t,o){var r=document.createEvent("MouseEvent");return r.initMouseEvent(e,!0,!0,window,0,0,0,t,o,!1,!1,!1,!1,0,null),r},e.findScrollTarget=function(t){for(var o=t.clientX,r=t.clientY,n=document.elementFromPoint(o,r);n;n=n.parentElement){var i=n.hasAttribute("data-lm-dragscroll");if(i=i||n.hasAttribute("data-p-dragscroll")){var s=0,a=0;n===document.body&&(s=window.pageXOffset,a=window.pageYOffset);var d=n.getBoundingClientRect(),c=d.top+a,u=d.left+s,l=u+d.width,p=c+d.height;if(!(o<u||o>=l||r<c||r>=p)){var h=o-u+1,m=r-c+1,v=l-o,g=p-r,f=Math.min(h,m,v,g);if(!(f>e.SCROLL_EDGE_SIZE)){var _=void 0;switch(f){case g:_="bottom";break;case m:_="top";break;case v:_="right";break;case h:_="left";break;default:throw"unreachable"}var E=n.scrollWidth-n.clientWidth,y=n.scrollHeight-n.clientHeight,L=void 0;switch(_){case"top":L=y>0&&n.scrollTop>0;break;case"left":L=E>0&&n.scrollLeft>0;break;case"right":L=E>0&&n.scrollLeft<E;break;case"bottom":L=y>0&&n.scrollTop<y;break;default:throw"unreachable"}if(L)return{element:n,edge:_,distance:f}}}}}return null},e.dispatchDragEnter=function(e,t,o,n){if(!t)return null;var i=r("lm-dragenter",e,n,o),s=!t.dispatchEvent(i);return s?t:(i=r("p-dragenter",e,n,o),(s=!t.dispatchEvent(i))?t:t===document.body?o:(i=r("lm-dragenter",e,n,o),document.body.dispatchEvent(i),i=r("p-dragenter",e,n,o),document.body.dispatchEvent(i),document.body))},e.dispatchDragExit=function(e,t,o,n){if(t){var i=r("lm-dragexit",e,n,o);t.dispatchEvent(i),i=r("p-dragexit",e,n,o),t.dispatchEvent(i)}},e.dispatchDragLeave=function(e,t,o,n){if(t){var i=r("lm-dragleave",e,n,o);t.dispatchEvent(i),i=r("p-dragleave",e,n,o),t.dispatchEvent(i)}},e.dispatchDragOver=function(e,t,o){if(!t)return"none";var n=r("lm-dragover",e,o,null),i=!t.dispatchEvent(n);return i?n.dropAction:(n=r("p-dragover",e,o,null),(i=!t.dispatchEvent(n))?n.dropAction:"none")},e.dispatchDrop=function(e,t,o){if(!t)return"none";var n=r("lm-drop",e,o,null),i=!t.dispatchEvent(n);return i?n.dropAction:(n=r("p-drop",e,o,null),(i=!t.dispatchEvent(n))?n.dropAction:"none")};var t={none:0,copy:1,link:2,move:4},o={none:t.none,copy:t.copy,link:t.link,move:t.move,"copy-link":t.copy|t.link,"copy-move":t.copy|t.move,"link-move":t.link|t.move,all:t.copy|t.link|t.move};function r(e,t,o,r){var n=document.createEvent("MouseEvent");return n.initMouseEvent(e,!0,!0,window,0,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,r),n.dropAction="none",n.mimeData=t.mimeData,n.proposedAction=t.proposedAction,n.supportedActions=t.supportedActions,n.source=t.source,n}}(o||(o={})),Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@lumino/dragdrop", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"description": "Lumino Drag and Drop", | ||
@@ -83,3 +83,3 @@ "homepage": "https://github.com/jupyterlab/lumino", | ||
"jsdelivr": "dist/index.min.js", | ||
"gitHead": "159c46252870a27e85766520b42e4d4f378a0913" | ||
"gitHead": "77ec35c598c56adc764ed6054bf91ef3e0d21e27" | ||
} |
@@ -285,2 +285,16 @@ // Copyright (c) Jupyter Development Team. | ||
/** | ||
* Move the drag image element to the specified location. | ||
* | ||
* This is a no-op if there is no drag image element. | ||
*/ | ||
protected moveDragImage(clientX: number, clientY: number): void { | ||
if (!this.dragImage) { | ||
return; | ||
} | ||
let style = this.dragImage.style; | ||
style.top = `${clientY}px`; | ||
style.left = `${clientX}px`; | ||
} | ||
/** | ||
* Handle the `'mousemove'` event for the drag object. | ||
@@ -301,3 +315,3 @@ */ | ||
// performed *after* dispatching to prevent unnecessary reflows. | ||
this._moveDragImage(event.clientX, event.clientY); | ||
this.moveDragImage(event.clientX, event.clientY); | ||
} | ||
@@ -475,16 +489,2 @@ | ||
/** | ||
* Move the drag image element to the specified location. | ||
* | ||
* This is a no-op if there is no drag image element. | ||
*/ | ||
private _moveDragImage(clientX: number, clientY: number): void { | ||
if (!this.dragImage) { | ||
return; | ||
} | ||
let style = this.dragImage.style; | ||
style.top = `${clientY}px`; | ||
style.left = `${clientX}px`; | ||
} | ||
/** | ||
* Detach the drag image element from the DOM. | ||
@@ -491,0 +491,0 @@ * |
@@ -177,2 +177,8 @@ import { MimeData } from '@lumino/coreutils'; | ||
/** | ||
* Move the drag image element to the specified location. | ||
* | ||
* This is a no-op if there is no drag image element. | ||
*/ | ||
protected moveDragImage(clientX: number, clientY: number): void; | ||
/** | ||
* Handle the `'mousemove'` event for the drag object. | ||
@@ -212,8 +218,2 @@ */ | ||
/** | ||
* Move the drag image element to the specified location. | ||
* | ||
* This is a no-op if there is no drag image element. | ||
*/ | ||
private _moveDragImage; | ||
/** | ||
* Detach the drag image element from the DOM. | ||
@@ -220,0 +220,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
297299