- mounted: function() {
- // Handle key stroke
- document.onkeydown = event => {
- // Is it Back or Esc? If yes, apply action on current word
- if (event.keyCode == 8) //Back
- {
- event.preventDefault();
- this.curPrefix = this.curPrefix.slice(0,-1);
- }
- else if (event.keyCode == 27) //Esc
- {
- event.preventDefault();
- this.curPrefix = "";
- }
- // Is it alphanumeric? If yes, stack it
- else if (_.range(48,58).includes(event.keyCode)
- || _.range(65,91).includes(event.keyCode)
- || _.range(97,123).includes(event.keyCode))
- {
- let newChar = String.fromCharCode(event.keyCode);
- this.curPrefix += this.curPrefix.length==0
- ? newChar.toUpperCase()
- : newChar.toLowerCase();
- }
- // ...ignore everything else
- };
- // Show welcome dialog box if "first visit"
- const visited = getCookie("visited");
- if (!visited || visited !== "1")
- document.getElementById("modal-welcome").checked = true;
+ methods: {
+ setDisplay: function() {
+ if (!location.hash)
+ location.hash = "#variants"; //default
+ this.display = location.hash.substr(1);
+ },
+