Commit 0c948d0a authored by Raine Makelainen's avatar Raine Makelainen

[embedlite-components] Reposition selection markers upon content reflow. Contributes to JB#36152

parent a075149a
......@@ -29,6 +29,9 @@ var SelectionHandler = {
addMessageListener("Browser:RepositionInfoRequest", this);
addMessageListener("Browser:SelectionHandlerPing", this);
addMessageListener("Browser:ResetLastPos", this);
// Handle orientation change, dynamic DOM manipulation etc
addMessageListener("Viewport:Change", this);
},
shutdown: function shutdown() {
......@@ -49,6 +52,8 @@ var SelectionHandler = {
removeMessageListener("Browser:RepositionInfoRequest", this);
removeMessageListener("Browser:SelectionHandlerPing", this);
removeMessageListener("Browser:ResetLastPos", this);
removeMessageListener("Viewport:Change", this);
},
sendAsync: function sendAsync(aMsg, aJson) {
......@@ -59,6 +64,12 @@ var SelectionHandler = {
* Browser event handlers
*/
_viewportChanged: function(metrics) {
if (this.isActive) {
this._updateSelectionUI("reflow", true, true);
}
},
/*
* Selection start event handler
*/
......@@ -562,6 +573,9 @@ var SelectionHandler = {
case "Browser:ResetLastPos":
this.onClickCoords(json.xPos, json.yPos);
break;
case "Viewport:Change":
this._viewportChanged(json);
break;
}
},
......
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