portree_kid 2020-07-26 21:11:22 +02:00
parent 6770b52f89
commit d6acedb384
2 changed files with 20 additions and 6 deletions

View File

@ -204,6 +204,13 @@ You should have received a copy of the GNU General Public License along with FG
console.log('make a check worker: ', path.resolve(__dirname, 'check.js'))
const worker = new Worker(winURL)
worker.onError = function(e) {
worker.terminate()
worker.view.max = 0
worker.view.checkDialogVisible = false
e.preventDefault(); // <-- "Hey browser, I handled it!"
}
console.log(fileUrl('src/renderer/utils/check.js'))
worker.checking = this.checking
@ -252,12 +259,6 @@ You should have received a copy of the GNU General Public License along with FG
}
// console.log(e.data)
}
worker.onError = function(e) {
worker.terminate()
worker.view.max = 0
worker.view.checkDialogVisible = false
e.preventDefault(); // <-- "Hey browser, I handled it!"
}
} catch (err) {
console.error(err)
}

View File

@ -89,6 +89,12 @@ You should have received a copy of the GNU General Public License along with FG
name: 'leaflet-sidebar',
components: { Help, AirportEdit, ArcEdit, CheckPanel, NodeEdit, ParkingEdit, ParkingGroupEdit, RunScan, FileSelect, SettingsPanel, Search, WorkInProgress },
props: [],
created () {
window.addEventListener('keydown', this.doCommand)
},
destroyed () {
window.removeEventListener('keydown', this.doCommand)
},
mounted () {
this.add()
},
@ -100,6 +106,13 @@ You should have received a copy of the GNU General Public License along with FG
}
},
methods: {
doCommand (e) {
let cmd = String.fromCharCode(e.keyCode).toLowerCase()
if (e.keyCode === 46 /** DEL */) {
this.$parent.$parent.$refs.editLayer.deleteFeature()
}
console.log(cmd)
},
deferredMountedTo (parent) {
this.sidebar = L.control.sidebar({
autopan: false, // whether to maintain the centered map point when opening the sidebar