Interface: DragGestureOptions
CloudControl Pro 9 Docs / floating_window / DragGestureOptions
Interface: DragGestureOptions
floating_window.DragGestureOptions
Dragging options of the floating window.
Table of contents
Properties
Properties
bounceDuration
• Optional
bounceDuration: number
The duration of the floating window's elastic bounce, the default is 300 milliseconds.
keepToEdge
• Optional
keepToEdge: KeepToEdgeType
The type of sticking to the edge of the floating window, can be true, false or "bounce", see KeepToEdgeType. The default is false.
onClick
• Optional
onClick: () => void
Type declaration
▸ (): void
Specifies the click listener of the anthor view for the drag gesture of the floating window. Since drag gestures are enabled to intercept touch events of the drag anchor view, you can no longer use the usual method to listen for clicks on it, this method provides an additional way to listen for its clicks.
Example
"nodejs";
const { createWindow } = require('floating_window');
async function main() {
const window = createWindow();
window.setViewFromXml(...);
const dragHandle = window.view.findView('dragHandle');
window.enableDrag(dragHandle, {
onClick: () => {
console.log('click');
}
});
window.show();
}
main().catch(console.error);
Returns
void
onLongClick
• Optional
onLongClick: () => void
Type declaration
▸ (): void
Specifies the long click listener of the anthor view for the drag gesture of the floating window. Since drag gestures are enabled to intercept touch events of the drag anchor view, you can no longer use the usual method to listen for long clicks on it, this method provides an additional way to listen for its long clicks.
Example
"nodejs";
const { createWindow } = require('floating_window');
async function main() {
const window = createWindow();
window.setViewFromXml(...);
const dragHandle = window.view.findView('dragHandle');
window.enableDrag(dragHandle, {
onLongClick: () => {
console.log('long click');
}
});
}
main().catch(console.error);
Returns
void