mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-31 04:49:05 +01:00
19 lines
No EOL
518 B
JavaScript
19 lines
No EOL
518 B
JavaScript
|
|
export function enableAnonymousActionHint(ctx) {
|
|
return function(actionId) {
|
|
const {services, actionService} = ctx;
|
|
const {left, top} = services.dom.viewerContainer.getBoundingClientRect();
|
|
actionService.showHintFor({
|
|
actionId,
|
|
x: left + 100,
|
|
y: top + 10,
|
|
requester: 'anonymous'
|
|
});
|
|
setTimeout(() => {
|
|
const value = actionService.hint$.value;
|
|
if (value && value.requester !== 'anonymous') {
|
|
actionService.showHintFor(null);
|
|
}
|
|
}, 1000);
|
|
}
|
|
} |