Update JQueryUI - DraggableEventUIParams (#49605)

* Update index.d.ts

The property `originalPosition` was missing in the `DraggableEventUIParams` type

* Update index.d.ts

* Add test

* Update index.d.ts
This commit is contained in:
Dieter Oberkofler
2020-12-18 20:38:32 +01:00
committed by GitHub
parent a2f8ea161f
commit 574cc23c69
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
// Type definitions for jQueryUI 1.12
// Project: http://jqueryui.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov>, John Reilly <https://github.com/johnnyreilly>
// Definitions by: Boris Yankov <https://github.com/borisyankov>, John Reilly <https://github.com/johnnyreilly>, Dieter Oberkofler <https://github.com/doberkofler>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -444,6 +444,7 @@ declare namespace JQueryUI {
interface DraggableEventUIParams {
helper: JQuery;
position: { top: number; left: number; };
originalPosition: { top: number; left: number; };
offset: { top: number; left: number; };
}

View File

@@ -13,7 +13,9 @@ function test_draggable() {
$("#draggable").draggable({
start: () => { },
drag: () => { },
stop: () => { }
stop: (event, ui) => {
var left = ui.originalPosition.left;
}
});
$("#draggable").draggable({ handle: "p" });
$("#draggable2").draggable({ cancel: "p.ui-widget-header" });