Commit d6e44395 authored by flothoni's avatar flothoni

shortcut.js; fix bug present since shortcut become a view

Link to #4303 & commit 4f2819381
parent 6ec207d2
Pipeline #150957 passed with stages
in 12 minutes and 24 seconds
...@@ -47,12 +47,17 @@ Shortcut.prototype = { ...@@ -47,12 +47,17 @@ Shortcut.prototype = {
this.system_shortcuts = {} this.system_shortcuts = {}
for (var system in germline_data.systems){ for (var system in germline_data.systems){
var keycode = germline_data.systems[system].shortcut.toUpperCase().charCodeAt(0)
if (typeof this.system_shortcuts[keycode] == "undefined") if (germline_data.systems[system].shortcut != undefined){ // at init/load, some data are not present
this.system_shortcuts[keycode] = [] var keycode = germline_data.systems[system].shortcut.toUpperCase().charCodeAt(0)
this.system_shortcuts[keycode].push(system) if (typeof this.system_shortcuts[keycode] == "undefined")
this.system_shortcuts[keycode] = []
this.system_shortcuts[keycode].push(system)
} else {
console.default.log("Shortcuts; system undefined: " + system)
}
} }
document.onkeydown = function (e) { self.checkKey(e); } document.onkeydown = function (e) { self.checkKey(e); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment