diff options
| author | mehekj <mehek.jethani@gmail.com> | 2023-03-23 15:16:40 -0400 |
|---|---|---|
| committer | mehekj <mehek.jethani@gmail.com> | 2023-03-23 15:16:40 -0400 |
| commit | 5c22004907c210951154017609746e86362c4fb5 (patch) | |
| tree | 108371dccd171c6bd523a01dc3f39a657d85ad96 /src/client/util/DragManager.ts | |
| parent | 016e51965ae2d0a83ca2d4e17000d57a40aac264 (diff) | |
| parent | 923f0fdb0f039a923e4e6f870158bd2f2ba32db0 (diff) | |
Merge branch 'master' into schema-mehek
Diffstat (limited to 'src/client/util/DragManager.ts')
| -rw-r--r-- | src/client/util/DragManager.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts index 1b413c73b..c35941ee5 100644 --- a/src/client/util/DragManager.ts +++ b/src/client/util/DragManager.ts @@ -10,7 +10,9 @@ import { BoolCast, Cast, NumCast, ScriptCast, StrCast } from '../../fields/Types import { emptyFunction, Utils } from '../../Utils'; import { Docs, DocUtils } from '../documents/Documents'; import * as globalCssVariables from '../views/global/globalCssVariables.scss'; +import { Colors } from '../views/global/globalEnums'; import { DocumentView } from '../views/nodes/DocumentView'; +import { ScriptingGlobals } from './ScriptingGlobals'; import { SnappingManager } from './SnappingManager'; import { UndoManager } from './UndoManager'; @@ -594,3 +596,8 @@ export namespace DragManager { endDrag?.(); } } + +ScriptingGlobals.add(function toggleRaiseOnDrag(readOnly?: boolean) { + if (readOnly) return DragManager.GetRaiseWhenDragged() ? Colors.MEDIUM_BLUE : 'transparent'; + DragManager.SetRaiseWhenDragged(!DragManager.GetRaiseWhenDragged()); +}); |
