Merge "ve.ce.Surface: Prevent focus loss on the document node in Opera"

This commit is contained in:
jenkins-bot 2013-07-29 17:17:47 +00:00 committed by Gerrit Code Review
commit 7021e0ab46

View file

@ -51,10 +51,18 @@ ve.ce.Surface = function VeCeSurface( model, surface, options ) {
this, { 'contentChange': 'onContentChange', 'selectionChange': 'onSelectionChange' }
);
this.model.connect( this, { 'change': 'onChange', 'lock': 'onLock', 'unlock': 'onUnlock' } );
this.documentView.getDocumentNode().$.on( {
var $documentNode = this.documentView.getDocumentNode().$;
$documentNode.on( {
'focus': ve.bind( this.documentOnFocus, this ),
'blur': ve.bind( this.documentOnBlur, this )
} );
$documentNode.on( 'focus', 'a', function () {
// Opera triggers 'blur' on document node before any link is
// focused and we don't want that
$documentNode[0].focus();
} );
this.$.on( {
'cut': ve.bind( this.onCut, this ),
'copy': ve.bind( this.onCopy, this ),