mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -04:00
Add sync scroll button (#481)
* Add disable sync scroll button Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
d488c8e2ad
commit
c95a7e0fba
12 changed files with 194 additions and 34 deletions
|
@ -1,9 +1,16 @@
|
|||
import { Reducer } from 'redux'
|
||||
import { EditorConfig, EditorConfigActions, EditorConfigActionType, SetEditorConfigAction } from './types'
|
||||
import {
|
||||
EditorConfig,
|
||||
EditorConfigActions,
|
||||
EditorConfigActionType,
|
||||
SetEditorConfigAction,
|
||||
SetEditorSyncScrollAction
|
||||
} from './types'
|
||||
import { EditorMode } from '../../components/editor/app-bar/editor-view-mode'
|
||||
|
||||
export const initialState: EditorConfig = {
|
||||
editorMode: EditorMode.BOTH
|
||||
editorMode: EditorMode.BOTH,
|
||||
syncScroll: true
|
||||
}
|
||||
|
||||
export const EditorConfigReducer: Reducer<EditorConfig, EditorConfigActions> = (state: EditorConfig = initialState, action: EditorConfigActions) => {
|
||||
|
@ -13,6 +20,11 @@ export const EditorConfigReducer: Reducer<EditorConfig, EditorConfigActions> = (
|
|||
...state,
|
||||
editorMode: (action as SetEditorConfigAction).mode
|
||||
}
|
||||
case EditorConfigActionType.SET_SYNC_SCROLL:
|
||||
return {
|
||||
...state,
|
||||
syncScroll: (action as SetEditorSyncScrollAction).syncScroll
|
||||
}
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue