diff --git a/src/components/dialogs/StartPrintDialog.vue b/src/components/dialogs/StartPrintDialog.vue index e7e9a3ca3a..e2c1779e25 100644 --- a/src/components/dialogs/StartPrintDialog.vue +++ b/src/components/dialogs/StartPrintDialog.vue @@ -82,9 +82,16 @@ export default class StartPrintDialog extends Mixins(BaseMixin, AfcMixin) { } startPrint(filename = '') { - filename = (this.currentPath + '/' + filename).substring(1) + if (!filename.includes('/')) { + filename = `${this.currentPath}/${filename}` + } + + if (filename.startsWith('/')) { + filename = filename.substring(1) + } + this.closeDialog() - this.$socket.emit('printer.print.start', { filename: filename }, { action: 'switchToDashboard' }) + this.$socket.emit('printer.print.start', { filename }, { action: 'switchToDashboard' }) } closeDialog() { diff --git a/src/components/dialogs/StartPrintDialogThumbnail.vue b/src/components/dialogs/StartPrintDialogThumbnail.vue index 571b80299a..dec014fe01 100644 --- a/src/components/dialogs/StartPrintDialogThumbnail.vue +++ b/src/components/dialogs/StartPrintDialogThumbnail.vue @@ -41,6 +41,11 @@ export default class StartPrintDialogThumbnail extends Mixins(BaseMixin) { } get currentPathWithoutSlash() { + // Status/History panel items already carry the full relative path in `filename`. + const lastSlashPos = this.file.filename.lastIndexOf('/') + if (lastSlashPos > 0) return this.file.filename.slice(0, lastSlashPos) + + // Gcodefiles panel items are basename-only; currentPath supplies the folder. if (this.currentPath.startsWith('/')) return this.currentPath.substring(1) return this.currentPath diff --git a/src/components/panels/Status/GcodefilesEntry.vue b/src/components/panels/Status/GcodefilesEntry.vue index 37ff3b2355..258658e269 100644 --- a/src/components/panels/Status/GcodefilesEntry.vue +++ b/src/components/panels/Status/GcodefilesEntry.vue @@ -123,8 +123,6 @@ export default class StatusPanelGcodefilesEntry extends Mixins(BaseMixin, Contro @Prop({ type: Object, required: true }) item!: FileStateGcodefile @Prop({ type: Number, required: true }) contentTdWidth!: number - currentPath = '' - contextMenuShow = false contextMenuX = 0 contextMenuY = 0