From e55c5b06697062c42d318ffed1d10ab366ff0851 Mon Sep 17 00:00:00 2001 From: jed Date: Mon, 26 Oct 2015 20:23:09 +0100 Subject: [PATCH 1/2] Let $keyboard trigger action-widgets Because of the refresh problems with the other widgets triggering action-widgets I am doing this one by itself. I hadn't included it before. This shouldn't have any more problems than the button widget does, and any problems caused by it should be fixed by any fix we use for the button widget. See #1564 for more background --- core/modules/widgets/keyboard.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/modules/widgets/keyboard.js b/core/modules/widgets/keyboard.js index 2eb392a75..004dddbd6 100644 --- a/core/modules/widgets/keyboard.js +++ b/core/modules/widgets/keyboard.js @@ -42,6 +42,10 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) { // Add a keyboard event handler domNode.addEventListener("keydown",function (event) { if($tw.utils.checkKeyDescriptor(event,self.keyInfo)) { + var handled = false; + if(self.invokeActions(this,event)) { + handled = true; + } self.dispatchMessage(event); event.preventDefault(); event.stopPropagation(); From 848e35168523c89313c31f7386105e3f2c3a1dfb Mon Sep 17 00:00:00 2001 From: jed Date: Mon, 16 Nov 2015 10:48:25 +0100 Subject: [PATCH 2/2] removed the handled variable because it serves no purpose here. That test isn't required in this context. --- core/modules/widgets/keyboard.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/modules/widgets/keyboard.js b/core/modules/widgets/keyboard.js index 004dddbd6..df32cc5b8 100644 --- a/core/modules/widgets/keyboard.js +++ b/core/modules/widgets/keyboard.js @@ -42,10 +42,7 @@ KeyboardWidget.prototype.render = function(parent,nextSibling) { // Add a keyboard event handler domNode.addEventListener("keydown",function (event) { if($tw.utils.checkKeyDescriptor(event,self.keyInfo)) { - var handled = false; - if(self.invokeActions(this,event)) { - handled = true; - } + self.invokeActions(this,event); self.dispatchMessage(event); event.preventDefault(); event.stopPropagation();