CatalogContents: simplify function declaration

This commit is contained in:
Seth Ladygo
2019-05-17 16:00:49 -07:00
parent 56099952a7
commit 7a23dcdf53

View File

@ -184,12 +184,12 @@ export default {
}, },
methods: { methods: {
selectSection: function(id) { selectSection(id) {
console.log('select section', id) console.log('select section', id)
this.$store.dispatch('selectSection', id) this.$store.dispatch('selectSection', id)
}, },
selectModel: function(id) { selectModel(id) {
console.log('select model', id) console.log('select model', id)
this.$store.dispatch('selectModel', id) this.$store.dispatch('selectModel', id)
}, },
@ -204,7 +204,7 @@ export default {
} }
}, },
sectionListItemClasses: function(id, hovering) { sectionListItemClasses(id, hovering) {
if (id === this.selectedSectionID) { if (id === this.selectedSectionID) {
return 'list-item primary' return 'list-item primary'
} else if (hovering) { } else if (hovering) {
@ -214,7 +214,7 @@ export default {
} }
}, },
modelListItemClasses: function(id, hovering) { modelListItemClasses(id, hovering) {
if (id === this.selectedModelID) { if (id === this.selectedModelID) {
return 'list-item primary' return 'list-item primary'
} else if (hovering) { } else if (hovering) {
@ -224,7 +224,7 @@ export default {
} }
}, },
materialListItemClasses: function(id, hovering) { materialListItemClasses(id, hovering) {
if (hovering) { if (hovering) {
return 'list-item grey lighten-4' return 'list-item grey lighten-4'
} else { } else {
@ -232,14 +232,14 @@ export default {
} }
}, },
reorderModel: function(fromIndex, toIndex) { reorderModel(fromIndex, toIndex) {
let models = this.selectedModels let models = this.selectedModels
arrayMove.mutate(models, fromIndex, toIndex) arrayMove.mutate(models, fromIndex, toIndex)
let pages = paginateModels(models) let pages = paginateModels(models)
this.setSectionPages({ section: this.selectedSection, pages: pages }) this.setSectionPages({ section: this.selectedSection, pages: pages })
}, },
reorderMaterial: function(fromIndex, toIndex) { reorderMaterial(fromIndex, toIndex) {
let mats = this.selectedMaterials let mats = this.selectedMaterials
arrayMove.mutate(mats, fromIndex, toIndex) arrayMove.mutate(mats, fromIndex, toIndex)
this.setModelMaterials({ model: this.selectedModel, materials: mats }) this.setModelMaterials({ model: this.selectedModel, materials: mats })