changeset in labs/bespinclient: Bug 588381 - Handle the click ev...

1 view
Skip to first unread message

Patrick Walton

unread,
Sep 13, 2010, 7:18:49 PM9/13/10
to bespin-...@googlegroups.com
changeset 1409622dc76f in /repo/hg/mozilla/labs/bespinclient
details: http://hg.mozilla.org/labs/bespinclient?cmd=changeset;node=1409622dc76f
description:
Bug 588381 - Handle the click event, and don't prevent the default behavior for mousedown events

diffstat:

plugins/supported/text_editor/views/text.js | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diffs (35 lines):

diff --git a/plugins/supported/text_editor/views/text.js b/plugins/supported/text_editor/views/text.js
--- a/plugins/supported/text_editor/views/text.js
+++ b/plugins/supported/text_editor/views/text.js
@@ -67,6 +67,7 @@ exports.TextView = function(container, e

var dom = this.domNode;
dom.style.cursor = "text";
+ dom.addEventListener('click', this.click.bind(this), false);
dom.addEventListener('mousedown', this.mouseDown.bind(this), false);
dom.addEventListener('mousemove', this.mouseMove.bind(this), false);
window.addEventListener('mouseup', this.mouseUp.bind(this), false);
@@ -467,6 +468,14 @@ util.mixin(exports.TextView.prototype, {
},

/**
+ * Handles click events and sets the focus appropriately. This is needed
+ * now that Firefox focus is tightened down; see bugs 125282 and 588381.
+ */
+ click: function(event) {
+ this.focus();
+ },
+
+ /**
* This is where the editor is painted from head to toe. Pitiful tricks are
* used to draw as little as possible.
*/
@@ -626,8 +635,6 @@ util.mixin(exports.TextView.prototype, {
},

mouseDown: function(evt) {
- util.stopEvent(evt);
-
this.hasFocus = true;
this._mouseIsDown = true;

Reply all
Reply to author
Forward
0 new messages