Skip to content

Commit

Permalink
Eslint fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniandre committed Oct 26, 2022
1 parent 3fb8206 commit 1eb9a0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/components/splitpanes/pane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<script>
export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'pane',
inject: ['requestUpdate', 'onPaneAdd', 'onPaneRemove', 'onPaneClick'],
Expand Down
21 changes: 10 additions & 11 deletions src/components/splitpanes/splitpanes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { h } from 'vue'
export default {
// eslint-disable-next-line vue/multi-word-component-names
name: 'splitpanes',
emits: ['ready', 'resize', 'resized', 'pane-click', 'pane-maximize', 'pane-add', 'pane-remove', 'splitter-click'],
Expand Down Expand Up @@ -321,7 +322,6 @@ export default {
child.parentNode.removeChild(child) // el.remove() doesn't work on IE11.
// eslint-disable-next-line no-console
console.warn('Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.')
return
}
})
},
Expand Down Expand Up @@ -372,7 +372,7 @@ export default {
// Called by Pane component on programmatic resize.
requestUpdate ({ target, ...args }) {
const pane = this.indexedPanes[target._.uid]
Object.entries(args).forEach(([key, value]) => pane[key] = value)
Object.entries(args).forEach(([key, value]) => (pane[key] = value))
},
onPaneAdd (pane) {
Expand All @@ -396,7 +396,7 @@ export default {
})
// Redo indexes after insertion for other shifted panes.
this.panes.forEach((p, i) => p.index = i)
this.panes.forEach((p, i) => (p.index = i))
if (this.ready) {
this.$nextTick(() => {
Expand All @@ -416,7 +416,7 @@ export default {
// 1. Remove the pane from array and redo indexes.
const index = this.panes.findIndex(p => p.id === pane._.uid)
const removed = this.panes.splice(index, 1)[0]
this.panes.forEach((p, i) => p.index = i)
this.panes.forEach((p, i) => (p.index = i))
this.$nextTick(() => {
// 2. Remove the splitter.
Expand All @@ -441,8 +441,8 @@ export default {
equalize () {
const equalSpace = 100 / this.panesCount
let leftToAllocate = 0
let ungrowable = []
let unshrinkable = []
const ungrowable = []
const unshrinkable = []
this.panes.forEach(pane => {
pane.size = Math.max(Math.min(equalSpace, pane.max), pane.min)
Expand All @@ -456,10 +456,9 @@ export default {
},
initialPanesSizing () {
let equalSpace = 100 / this.panesCount
let leftToAllocate = 100
let ungrowable = []
let unshrinkable = []
const ungrowable = []
const unshrinkable = []
let definedSizes = 0
// Check if pre-allocated space is 100%.
Expand Down Expand Up @@ -487,8 +486,8 @@ export default {
equalizeAfterAddOrRemove ({ addedPane, removedPane } = {}) {
let equalSpace = 100 / this.panesCount
let leftToAllocate = 0
let ungrowable = []
let unshrinkable = []
const ungrowable = []
const unshrinkable = []
if (addedPane && addedPane.givenSize !== null) {
equalSpace = (100 - addedPane.givenSize) / (this.panesCount - 1)
Expand Down

0 comments on commit 1eb9a0f

Please sign in to comment.