Commit 07168638 authored by Curtis Adam's avatar Curtis Adam

Merge branch 'staging' into 'master'

Update the keyCode events for the Editor view

See merge request arsnova/flashcards!1738
parents 163b9489 51c5e5aa
...@@ -47,8 +47,8 @@ export let CardEditor = class CardEditor { ...@@ -47,8 +47,8 @@ export let CardEditor = class CardEditor {
} }
static setLearningGoalLevel (forward = true) { static setLearningGoalLevel (forward = true) {
let navigationLength = $('#learningGoalLevelGroup:first label').length; let navigationLength = $('#learningGoalLevelGroup:first button').length;
let index = ($(".active").index("#learningGoalLevelGroup:first label")) + 1; let index = ($(".active").index("#learningGoalLevelGroup:first button")) + 1;
if (forward) { if (forward) {
if (index >= navigationLength) { if (index >= navigationLength) {
index = 1; index = 1;
......
...@@ -297,7 +297,11 @@ export let CardNavigation = class CardNavigation { ...@@ -297,7 +297,11 @@ export let CardNavigation = class CardNavigation {
keyCodes = [9]; keyCodes = [9];
} }
if (Route.isEditMode()) { if (Route.isEditMode()) {
keyCodes = [9, 37, 39]; if ($('.learningGoalLevelButton').is(":focus")) {
keyCodes = [9, 37, 39];
} else {
keyCodes = [9];
}
} }
if (Route.isDemo()) { if (Route.isDemo()) {
keyCodes = [9, 32, 37, 38, 39, 40]; keyCodes = [9, 32, 37, 38, 39, 40];
...@@ -329,9 +333,7 @@ export let CardNavigation = class CardNavigation { ...@@ -329,9 +333,7 @@ export let CardNavigation = class CardNavigation {
break; break;
case 37: case 37:
if (Route.isEditMode() && !CardVisuals.isFullscreen()) { if (Route.isEditMode() && !CardVisuals.isFullscreen()) {
if (CardEditor.getEditorButtons()[CardEditor.getEditorButtonIndex() - 1] === CardEditor.getLearningGoalLevelGroupName()) { CardEditor.setLearningGoalLevel(false);
CardEditor.setLearningGoalLevel(false);
}
} else { } else {
if (CardNavigation.isVisible()) { if (CardNavigation.isVisible()) {
if ($('#leftCarouselControl').click()) { if ($('#leftCarouselControl').click()) {
...@@ -350,9 +352,7 @@ export let CardNavigation = class CardNavigation { ...@@ -350,9 +352,7 @@ export let CardNavigation = class CardNavigation {
break; break;
case 39: case 39:
if (Route.isEditMode() && !CardVisuals.isFullscreen()) { if (Route.isEditMode() && !CardVisuals.isFullscreen()) {
if (CardEditor.getEditorButtons()[CardEditor.getEditorButtonIndex() - 1] === CardEditor.getLearningGoalLevelGroupName()) { CardEditor.setLearningGoalLevel();
CardEditor.setLearningGoalLevel();
}
} else { } else {
if (CardNavigation.isVisible()) { if (CardNavigation.isVisible()) {
if ($('#rightCarouselControl').click()) { if ($('#rightCarouselControl').click()) {
......
<template name="learningGoalLevel"> <template name="learningGoalLevel">
<div id="learningGoalLevelGroup" class="form-group btn-group col-xs-12" role="group" data-toggle="buttons"> <div id="learningGoalLevelGroup" class="form-group btn-group col-xs-12" role="group" data-toggle="buttons">
<label id="learningGoalLevel0" <button id="learningGoalLevel0"
class="col-xs-6 col-sm-2 btn btn-raised {{#if isLearningGoalLevelChecked class="col-xs-6 col-sm-2 learningGoalLevelButton btn btn-raised {{#if isLearningGoalLevelChecked
0}}btn-primary{{else}}btn-white{{/if}} {{#if 0}}btn-primary{{else}}btn-white{{/if}} {{#if
isLearningGoalLevel 0}}active{{/if}}" isLearningGoalLevel 0}}active{{/if}}"
data-lvl="0"> data-lvl="0">
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
<input type="radio" name="learningGoalLevel" value="0" data-lvl="0"> <input type="radio" name="learningGoalLevel" value="0" data-lvl="0">
{{/if}} {{/if}}
{{_ "learning-goal.level1"}} {{_ "learning-goal.level1"}}
</label> </button>
<label id="learningGoalLevel1" <button id="learningGoalLevel1"
class="col-xs-6 col-sm-2 btn btn-raised {{#if isLearningGoalLevelChecked class="col-xs-6 col-sm-2 learningGoalLevelButton btn btn-raised {{#if isLearningGoalLevelChecked
1}}btn-primary{{else}}btn-white{{/if}} {{#if 1}}btn-primary{{else}}btn-white{{/if}} {{#if
isLearningGoalLevel 1}}active{{/if}}" isLearningGoalLevel 1}}active{{/if}}"
data-lvl="1"> data-lvl="1">
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
<input type="radio" name="learningGoalLevel" value="1" data-lvl="1"> <input type="radio" name="learningGoalLevel" value="1" data-lvl="1">
{{/if}} {{/if}}
{{_ "learning-goal.level2"}} {{_ "learning-goal.level2"}}
</label> </button>
<label id="learningGoalLevel2" <button id="learningGoalLevel2"
class="col-xs-6 col-sm-2 btn btn-raised {{#if isLearningGoalLevelChecked class="col-xs-6 col-sm-2 learningGoalLevelButton btn btn-raised {{#if isLearningGoalLevelChecked
2}}btn-primary{{else}}btn-white{{/if}} {{#if 2}}btn-primary{{else}}btn-white{{/if}} {{#if
isLearningGoalLevel 2}}active{{/if}}" isLearningGoalLevel 2}}active{{/if}}"
data-lvl="2"> data-lvl="2">
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
<input type="radio" name="learningGoalLevel" value="2" data-lvl="2"> <input type="radio" name="learningGoalLevel" value="2" data-lvl="2">
{{/if}} {{/if}}
{{_ "learning-goal.level3"}} {{_ "learning-goal.level3"}}
</label> </button>
<label id="learningGoalLevel3" <button id="learningGoalLevel3"
class="col-xs-6 col-sm-2 btn btn-raised {{#if isLearningGoalLevelChecked class="col-xs-6 col-sm-2 learningGoalLevelButton btn btn-raised {{#if isLearningGoalLevelChecked
3}}btn-primary{{else}}btn-white{{/if}} {{#if 3}}btn-primary{{else}}btn-white{{/if}} {{#if
isLearningGoalLevel 3}}active{{/if}}" isLearningGoalLevel 3}}active{{/if}}"
data-lvl="3"> data-lvl="3">
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
<input type="radio" name="learningGoalLevel" value="3" data-lvl="3"> <input type="radio" name="learningGoalLevel" value="3" data-lvl="3">
{{/if}} {{/if}}
{{_ "learning-goal.level4"}} {{_ "learning-goal.level4"}}
</label> </button>
<label id="learningGoalLevel4" <button id="learningGoalLevel4"
class="col-xs-6 col-sm-2 btn btn-raised {{#if isLearningGoalLevelChecked class="col-xs-6 col-sm-2 learningGoalLevelButton btn btn-raised {{#if isLearningGoalLevelChecked
4}}btn-primary{{else}}btn-white{{/if}} {{#if 4}}btn-primary{{else}}btn-white{{/if}} {{#if
isLearningGoalLevel 4}}active{{/if}}" isLearningGoalLevel 4}}active{{/if}}"
data-lvl="4"> data-lvl="4">
...@@ -59,9 +59,9 @@ ...@@ -59,9 +59,9 @@
<input type="radio" name="learningGoalLevel" value="4" data-lvl="4"> <input type="radio" name="learningGoalLevel" value="4" data-lvl="4">
{{/if}} {{/if}}
{{_ "learning-goal.level5"}} {{_ "learning-goal.level5"}}
</label> </button>
<label id="learningGoalLevel5" <button id="learningGoalLevel5"
class="col-xs-6 col-sm-2 btn btn-raised {{#if isLearningGoalLevelChecked class="col-xs-6 col-sm-2 learningGoalLevelButton btn btn-raised {{#if isLearningGoalLevelChecked
5}}btn-primary{{else}}btn-white{{/if}} {{#if 5}}btn-primary{{else}}btn-white{{/if}} {{#if
isLearningGoalLevel 5}}active{{/if}}" isLearningGoalLevel 5}}active{{/if}}"
data-lvl="5"> data-lvl="5">
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<input type="radio" name="learningGoalLevel" value="5" data-lvl="5"> <input type="radio" name="learningGoalLevel" value="5" data-lvl="5">
{{/if}} {{/if}}
{{_ "learning-goal.level6"}} {{_ "learning-goal.level6"}}
</label> </button>
</div> </div>
</template> </template>
......
...@@ -3913,6 +3913,7 @@ ...@@ -3913,6 +3913,7 @@
"version": "0.0.9", "version": "0.0.9",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"inherits": "~2.0.0" "inherits": "~2.0.0"
} }
...@@ -3937,7 +3938,8 @@ ...@@ -3937,7 +3938,8 @@
"buffer-shims": { "buffer-shims": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"caseless": { "caseless": {
"version": "0.12.0", "version": "0.12.0",
...@@ -3954,12 +3956,14 @@ ...@@ -3954,12 +3956,14 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"combined-stream": { "combined-stream": {
"version": "1.0.5", "version": "1.0.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"delayed-stream": "~1.0.0" "delayed-stream": "~1.0.0"
} }
...@@ -3972,17 +3976,20 @@ ...@@ -3972,17 +3976,20 @@
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"cryptiles": { "cryptiles": {
"version": "2.0.5", "version": "2.0.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"boom": "2.x.x" "boom": "2.x.x"
} }
...@@ -4022,7 +4029,8 @@ ...@@ -4022,7 +4029,8 @@
"delayed-stream": { "delayed-stream": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"delegates": { "delegates": {
"version": "1.0.0", "version": "1.0.0",
...@@ -4054,7 +4062,8 @@ ...@@ -4054,7 +4062,8 @@
"extsprintf": { "extsprintf": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"forever-agent": { "forever-agent": {
"version": "0.6.1", "version": "0.6.1",
...@@ -4177,6 +4186,7 @@ ...@@ -4177,6 +4186,7 @@
"version": "3.1.3", "version": "3.1.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"boom": "2.x.x", "boom": "2.x.x",
"cryptiles": "2.x.x", "cryptiles": "2.x.x",
...@@ -4224,6 +4234,7 @@ ...@@ -4224,6 +4234,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
...@@ -4237,7 +4248,8 @@ ...@@ -4237,7 +4248,8 @@
"isarray": { "isarray": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"isstream": { "isstream": {
"version": "0.1.2", "version": "0.1.2",
...@@ -4310,12 +4322,14 @@ ...@@ -4310,12 +4322,14 @@
"mime-db": { "mime-db": {
"version": "1.27.0", "version": "1.27.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"mime-types": { "mime-types": {
"version": "2.1.15", "version": "2.1.15",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"mime-db": "~1.27.0" "mime-db": "~1.27.0"
} }
...@@ -4391,7 +4405,8 @@ ...@@ -4391,7 +4405,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"oauth-sign": { "oauth-sign": {
"version": "0.8.2", "version": "0.8.2",
...@@ -4449,7 +4464,8 @@ ...@@ -4449,7 +4464,8 @@
"process-nextick-args": { "process-nextick-args": {
"version": "1.0.7", "version": "1.0.7",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"punycode": { "punycode": {
"version": "1.4.1", "version": "1.4.1",
...@@ -4487,6 +4503,7 @@ ...@@ -4487,6 +4503,7 @@
"version": "2.2.9", "version": "2.2.9",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"buffer-shims": "~1.0.0", "buffer-shims": "~1.0.0",
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
...@@ -4538,7 +4555,8 @@ ...@@ -4538,7 +4555,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.0.1", "version": "5.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"semver": { "semver": {
"version": "5.3.0", "version": "5.3.0",
...@@ -4562,6 +4580,7 @@ ...@@ -4562,6 +4580,7 @@
"version": "1.0.9", "version": "1.0.9",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"hoek": "2.x.x" "hoek": "2.x.x"
} }
...@@ -4595,6 +4614,7 @@ ...@@ -4595,6 +4614,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
...@@ -4605,6 +4625,7 @@ ...@@ -4605,6 +4625,7 @@
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.0.1" "safe-buffer": "^5.0.1"
} }
...@@ -4633,6 +4654,7 @@ ...@@ -4633,6 +4654,7 @@
"version": "2.2.1", "version": "2.2.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"block-stream": "*", "block-stream": "*",
"fstream": "^1.0.2", "fstream": "^1.0.2",
...@@ -4688,7 +4710,8 @@ ...@@ -4688,7 +4710,8 @@
"util-deprecate": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"uuid": { "uuid": {
"version": "3.0.1", "version": "3.0.1",
...@@ -4774,7 +4797,7 @@ ...@@ -4774,7 +4797,7 @@
}, },
"gherkin": { "gherkin": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/gherkin/-/gherkin-4.0.0.tgz", "resolved": "http://registry.npmjs.org/gherkin/-/gherkin-4.0.0.tgz",
"integrity": "sha1-edzgTRIj6kO0hip2vlzo+JwSwyw=", "integrity": "sha1-edzgTRIj6kO0hip2vlzo+JwSwyw=",
"dev": true "dev": true
}, },
...@@ -5573,18 +5596,6 @@ ...@@ -5573,18 +5596,6 @@
"hoek": "2.x.x", "hoek": "2.x.x",
"joi": "6.x.x", "joi": "6.x.x",
"wreck": "5.x.x" "wreck": "5.x.x"
},
"dependencies": {
"wreck": {
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/wreck/-/wreck-5.6.1.tgz",
"integrity": "sha1-r/ADBAATiJ11YZtccYcN0qjdBpo=",
"dev": true,
"requires": {
"boom": "2.x.x",
"hoek": "2.x.x"
}
}
} }
}, },
"heavy": { "heavy": {
...@@ -5596,20 +5607,6 @@ ...@@ -5596,20 +5607,6 @@
"boom": "2.x.x", "boom": "2.x.x",
"hoek": "2.x.x", "hoek": "2.x.x",
"joi": "5.x.x" "joi": "5.x.x"
},
"dependencies": {
"joi": {
"version": "5.1.0",
"resolved": "http://registry.npmjs.org/joi/-/joi-5.1.0.tgz",
"integrity": "sha1-FSrQfbjunGQBmX/1/SwSiWBwv1g=",
"dev": true,
"requires": {
"hoek": "^2.2.x",
"isemail": "1.x.x",
"moment": "2.x.x",
"topo": "1.x.x"
}
}
} }
}, },
"hoek": { "hoek": {
...@@ -6457,12 +6454,6 @@ ...@@ -6457,12 +6454,6 @@
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
}, },
"isemail": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz",
"integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=",
"dev": true
},
"isexe": { "isexe": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
...@@ -7854,31 +7845,6 @@ ...@@ -7854,31 +7845,6 @@
"safe-buffer": "~5.1.1", "safe-buffer": "~5.1.1",
"string_decoder": "~1.1.0", "string_decoder": "~1.1.0",
"util-deprecate": "~1.0.1" "util-deprecate": "~1.0.1"
},
"dependencies": {
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"process-nextick-args": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
} }
}, },
"rimraf": { "rimraf": {
......
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