Restore focus to documentNode on convert

Since format dropdown tool is the only tool where we actually lose
focus to the documentNode, we must restore focus so that firefox
and chrome will display a cursor after converting content branches.

Bug: 50338
Change-Id: I4059b2688565570e0efc21078035775b7aed49e1
This commit is contained in:
Rob Moen 2013-07-01 11:58:54 -07:00 committed by Roan Kattouw
parent c75e379086
commit beadbba79b

View file

@ -68,6 +68,10 @@ ve.ui.FormatAction.prototype.convert = function ( type, attributes ) {
} }
selection = fragmentForSelection.getRange(); selection = fragmentForSelection.getRange();
// Since format dropdown tool is a focusable menu, documentNode has lost focus.
// Restore focus to documentNode so that firefox will display the cursor after conversion.
this.surface.view.documentView.documentNode.$[0].focus();
txs = ve.dm.Transaction.newFromContentBranchConversion( doc, selection, type, attributes ); txs = ve.dm.Transaction.newFromContentBranchConversion( doc, selection, type, attributes );
surfaceModel.change( txs, selection ); surfaceModel.change( txs, selection );
}; };