Commit a075149a authored by Raine Makelainen's avatar Raine Makelainen

[embedlite-components] Snap selection to word when selecting non editable content

parent 22112c48
......@@ -10,7 +10,7 @@ dump("### SelectionHandler.js loaded\n");
var SelectionHandler = {
init: function init() {
this.type = kContentSelector;
this.snap = true;
this.snap = false;
this.lastYPos = this.lastXPos = null;
addMessageListener("Browser:SelectionStart", this);
addMessageListener("Browser:SelectionAttach", this);
......
......@@ -237,6 +237,11 @@ SelectionPrototype.prototype = {
this._cache.updateCaret = aUpdateCaret || false;
this._cache.targetIsEditable = this._targetIsEditable;
// Snap to word when content is not editable
if (this._cache.src == "start") {
this.snap = !this._cache.targetIsEditable;
}
// Get monocles positioned correctly
this.sendAsync("Content:SelectionRange", this._cache);
},
......
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