diff --git a/core/modules/editor/engines/framed.js b/core/modules/editor/engines/framed.js index 6e7da24da..5eee8255b 100644 --- a/core/modules/editor/engines/framed.js +++ b/core/modules/editor/engines/framed.js @@ -79,6 +79,7 @@ function FramedEngine(options) { // Add event listeners $tw.utils.addEventListeners(this.domNode,[ {name: "click",handlerObject: this,handlerMethod: "handleClickEvent"}, + {name: "focus",handlerObject: this.widget,handlerMethod: "handleFocusEvent"}, {name: "input",handlerObject: this,handlerMethod: "handleInputEvent"}, {name: "keydown",handlerObject: this.widget,handlerMethod: "handleKeydownEvent"} ]); @@ -152,6 +153,13 @@ FramedEngine.prototype.focus = function() { this.domNode.select(); } }; + +/* +Handle the focus event +*/ +FramedEngine.prototype.handleFocusEvent = function() { + this.widget.cancelPopups(); +}; /* Handle a click