|
@@ -790,6 +790,7 @@ const app = Vue.createApp({
|
|
|
*/
|
|
|
handleUndo()
|
|
|
{
|
|
|
+ this.appComponent.focus();
|
|
|
if (this.canUndo())
|
|
|
{
|
|
|
this.currentStateIndex -= 1;
|
|
@@ -811,6 +812,7 @@ const app = Vue.createApp({
|
|
|
*/
|
|
|
handleRedo()
|
|
|
{
|
|
|
+ this.appComponent.focus();
|
|
|
if (this.canRedo())
|
|
|
{
|
|
|
this.currentStateIndex += 1;
|
|
@@ -827,10 +829,14 @@ const app = Vue.createApp({
|
|
|
*/
|
|
|
initializeUndoFunctionality()
|
|
|
{
|
|
|
+ this.appComponent = document.getElementById('app'); // todo this doesn't work yet
|
|
|
this.handleStateUpdate();
|
|
|
const component = this;
|
|
|
document.addEventListener('keydown', function (event)
|
|
|
{
|
|
|
+ console.log('keypress event:')
|
|
|
+ console.log(event)
|
|
|
+ console.log('ctrl?', event.ctrlKey)
|
|
|
if (component.getModifierKeyByOs(event) && event.key === 'z')
|
|
|
{
|
|
|
event.preventDefault();
|