Skip to content

Commit

Permalink
Merge pull request #11 from DenninDalke/master
Browse files Browse the repository at this point in the history
v1.7.1 - Fix TypeError issue
  • Loading branch information
Moerill authored Dec 12, 2020
2 parents 2b10a77 + b256ad7 commit b34e1c9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
8 changes: 4 additions & 4 deletions dist/scripts/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/scripts/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "module-template",
"version": "1.7.0",
"name": "layer-hotkeys",
"version": "1.7.1",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
11 changes: 7 additions & 4 deletions src/scripts/layer-hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,24 @@ export default function() {
Hooks.on('renderSceneControls', (app, html, data) => {
let scene_control = html.children('li.scene-control');
let layerKeys = {};
for (let [key, value] of Object.entries(CONFIG["layer-hotkeys"].layer))
let config = CONFIG["layer-hotkeys"];
if (config === undefined) return;

for (let [key, value] of Object.entries(config.layer))
layerKeys[value] = key;
let toolKeys = {};
for (let [key, value] of Object.entries(CONFIG["layer-hotkeys"].tool))
for (let [key, value] of Object.entries(config.tool))
toolKeys[value] = key;

for (let i = 0; i < scene_control.length; i++) {
const li = scene_control[i];
let title = li.getAttribute("title");
let key = CONFIG["layer-hotkeys"].layer[li.getAttribute("data-control")];
let key = config.layer[li.getAttribute("data-control")];
if (key !== undefined)
li.title += " [" + key.toUpperCase() + "]";
let ctrls = li.getElementsByClassName('control-tool');
for (let j = 0; j < ctrls.length; j++) {
let title = ctrls[j].title + " [" + CONFIG["layer-hotkeys"].tool[j+1] + "]";
let title = ctrls[j].title + " [" + config.tool[j+1] + "]";
ctrls[j].title = title;
}
}
Expand Down

0 comments on commit b34e1c9

Please sign in to comment.