mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Merge pull request #29881 from danmana/dragula
@types/dragula Add chaining support. Closes #15422
This commit is contained in:
@@ -30,3 +30,14 @@ var drake = dragula({
|
||||
copy: true
|
||||
});
|
||||
drake.containers.push(document.querySelector('#container'));
|
||||
|
||||
dragula([document.getElementById('left'), document.getElementById('right')])
|
||||
.on('drag', function (el: Element) {
|
||||
el.className = el.className.replace('ex-moved', '');
|
||||
}).on('drop', function (el: Element) {
|
||||
el.className += ' ex-moved';
|
||||
}).on('over', function (el: Element, container: Element) {
|
||||
container.className += ' ex-over';
|
||||
}).on('out', function (el: Element, container: Element) {
|
||||
container.className = container.className.replace('ex-over', '');
|
||||
});
|
||||
|
||||
2
types/dragula/index.d.ts
vendored
2
types/dragula/index.d.ts
vendored
@@ -33,7 +33,7 @@ declare namespace dragula {
|
||||
cancel(revert:boolean): void;
|
||||
cancel(): void;
|
||||
remove(): void;
|
||||
on(events: string, callback: Function): void;
|
||||
on(events: string, callback: Function): Drake;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user