Skip to content

Commit

Permalink
refactor: small update
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Nov 17, 2022
1 parent 3b517f1 commit a6f5d2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions src/views/addToggleMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ export default function addToggleMode({ id, on, turnOn, off, turnOff }) {

function toggleMode() {
if (
[].find.call(modeIcon.classList, (name) => {
return name === 'bp3-icon-' + on
})
[].find.call(modeIcon.classList, (name) => name === 'bp3-icon-' + on)
) {
modeIcon.className = `bp3-button bp3-minimal bp3-icon-${off} bp3-small`
turnOff && turnOff()
turnOff?.()
} else {
modeIcon.className = `bp3-button bp3-minimal bp3-icon-${on} bp3-small`
turnOn && turnOn()
turnOn?.()
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/views/card-list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { appendIcon, switchTo } from '../utils/dom-helper'
import addHotKeys from '../utils/hotkey'
import './card-list.less'
import addToggleMode from './addToggleMode'
import { switchTo } from '../utils/dom-helper';
import addHotKeys from '../utils/hotkey';
import addToggleMode from './addToggleMode';
import './card-list.less';

export default function initCardListMode() {
const toggleCardMode = addToggleMode({
Expand Down

0 comments on commit a6f5d2a

Please sign in to comment.