Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/148966
Change subject: Highlight and bind events to $focusable, not $element
......................................................................
Highlight and bind events to $focusable, not $element
Still use this.$element for setting classes and properties.
Change-Id: I2415bbcdf94bbb25773a37e4f3a5048a567bb025
---
M modules/ve/ce/ve.ce.FocusableNode.js
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/66/148966/1
diff --git a/modules/ve/ce/ve.ce.FocusableNode.js
b/modules/ve/ce/ve.ce.FocusableNode.js
index 4ae1bec..b627f2e 100644
--- a/modules/ve/ce/ve.ce.FocusableNode.js
+++ b/modules/ve/ce/ve.ce.FocusableNode.js
@@ -100,7 +100,7 @@
.prop( 'contentEditable', 'false' );
// Events
- this.$element.on( {
+ this.$focusable.on( {
'mouseenter.ve-ce-focusableNode': ve.bind(
this.onFocusableMouseEnter, this ),
'mousedown.ve-ce-focusableNode touchend.ve-ce-focusableNode':
ve.bind( this.onFocusableMouseDown, this )
} );
@@ -120,7 +120,7 @@
}
// Events
- this.$element.off( '.ve-ce-focusableNode' );
+ this.$focusable.off( '.ve-ce-focusableNode' );
// Highlights
this.clearHighlights();
@@ -308,13 +308,13 @@
this.focused = value;
if ( this.focused ) {
this.emit( 'focus' );
- this.$focusable.addClass( 've-ce-node-focused' );
+ this.$element.addClass( 've-ce-focusableNode-focused' );
this.createHighlights();
this.surface.appendHighlights( this.$highlights,
this.focused );
this.surface.$element.off( '.ve-ce-focusableNode' );
} else {
this.emit( 'blur' );
- this.$focusable.removeClass( 've-ce-node-focused' );
+ this.$element.removeClass(
've-ce-focusableNode-focused' );
this.clearHighlights();
}
}
@@ -402,7 +402,7 @@
rect2.bottom <= rect1.bottom;
}
- this.$element.find( '*' ).addBack().each( function () {
+ this.$focusable.find( '*' ).addBack().each( function () {
var i, j, il, jl, contained, clientRects;
if ( $( this ).hasClass( 've-ce-noHighlight' ) ) {
--
To view, visit https://gerrit.wikimedia.org/r/148966
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2415bbcdf94bbb25773a37e4f3a5048a567bb025
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits