diff --git a/.eslintrc.js b/.eslintrc.js index 67f37302..b341568c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -45,7 +45,7 @@ module.exports = { }], 'default-case': 'error', 'consistent-this': ['error', '_this'], - 'max-depth': ['error', 4], + 'max-depth': ['error', 5], 'max-lines': ['error', 800], 'no-multi-str': 'error', 'space-infix-ops': 'error', diff --git a/src/components/ColorPicker/Saturation.vue b/src/components/ColorPicker/Saturation.vue index 08cd8f0d..8ae26e9b 100644 --- a/src/components/ColorPicker/Saturation.vue +++ b/src/components/ColorPicker/Saturation.vue @@ -47,7 +47,7 @@ export default defineComponent({ const pointerTop = computed(() => (-(color.value.v * 100) + 1) + 100 + '%') const pointerLeft = computed(() => color.value.s * 100 + '%') - const emitChangeEvent = throttle(function (param) { + const emitChangeEvent = throttle(function(param) { emit('colorChange', param) }, 20, { leading: true, trailing: false }) diff --git a/src/components/Contextmenu/MenuContent.vue b/src/components/Contextmenu/MenuContent.vue index edda174d..b7e18e51 100644 --- a/src/components/Contextmenu/MenuContent.vue +++ b/src/components/Contextmenu/MenuContent.vue @@ -81,7 +81,7 @@ $subMenuWidth: 120px; } &:hover:not(.disable) { - background-color: #e1e1e1; + background-color: rgba($color: $themeColor, $alpha: .2); } &.divider { diff --git a/src/hooks/useHistorySnapshot.ts b/src/hooks/useHistorySnapshot.ts index 19b328e6..6f851e2d 100644 --- a/src/hooks/useHistorySnapshot.ts +++ b/src/hooks/useHistorySnapshot.ts @@ -5,15 +5,15 @@ import { ActionTypes, useStore } from '@/store' export default () => { const store = useStore() - const addHistorySnapshot = debounce(function () { + const addHistorySnapshot = debounce(function() { store.dispatch(ActionTypes.ADD_SNAPSHOT) }, 300, { trailing: true }) - const redo = throttle(function () { + const redo = throttle(function() { store.dispatch(ActionTypes.RE_DO) }, 100, { leading: true, trailing: false }) - const undo = throttle(function () { + const undo = throttle(function() { store.dispatch(ActionTypes.UN_DO) }, 100, { leading: true, trailing: false }) diff --git a/src/views/Screen/index.vue b/src/views/Screen/index.vue index 5cef8d8f..8f9cd790 100644 --- a/src/views/Screen/index.vue +++ b/src/views/Screen/index.vue @@ -175,7 +175,7 @@ export default defineComponent({ ) execNext() } - const mousewheelListener = throttle(function (e: WheelEvent) { + const mousewheelListener = throttle(function(e: WheelEvent) { if (e.deltaY < 0) execPrev() else if (e.deltaY > 0) execNext() }, 500, { leading: true, trailing: false }) diff --git a/src/views/components/element/TableElement/EditableTable.vue b/src/views/components/element/TableElement/EditableTable.vue index 495fda21..66ce4945 100644 --- a/src/views/components/element/TableElement/EditableTable.vue +++ b/src/views/components/element/TableElement/EditableTable.vue @@ -524,7 +524,7 @@ export default defineComponent({ } } - const handleInput = debounce(function () { + const handleInput = debounce(function() { emit('change', tableCells.value) }, 300, { trailing: true }) diff --git a/src/views/components/element/TextElement/index.vue b/src/views/components/element/TextElement/index.vue index 4f05b825..15b0e855 100644 --- a/src/views/components/element/TextElement/index.vue +++ b/src/views/components/element/TextElement/index.vue @@ -137,7 +137,7 @@ export default defineComponent({ const handleBlur = () => { store.commit(MutationTypes.SET_DISABLE_HOTKEYS_STATE, false) } - const handleInput = debounce(function () { + const handleInput = debounce(function() { store.commit(MutationTypes.UPDATE_ELEMENT, { id: props.elementInfo.id, props: { content: editorView.dom.innerHTML }, @@ -145,7 +145,7 @@ export default defineComponent({ addHistorySnapshot() }, 300, { trailing: true }) - const handleClick = debounce(function () { + const handleClick = debounce(function() { const attr = getTextAttrs(editorView) emitter.emit(EmitterEvents.UPDATE_TEXT_STATE, attr) }, 30, { trailing: true })