Merge "mw.ViewPageTarget: Use .mw-body-content for content styling"

This commit is contained in:
jenkins-bot 2014-04-29 22:25:53 +00:00 committed by Gerrit Code Review
commit da577b21d5
3 changed files with 12 additions and 3 deletions

View file

@ -20,7 +20,7 @@ class VisualEditorHooks {
// parties who attempt to install VisualEditor onto non-alpha wikis, as
// this should have no impact on deploying to Wikimedia's wiki cluster.
// Is fine for release tarballs because 1.22wmf11 < 1.22alpha < 1.22.0.
wfUseMW( '1.22' );
wfUseMW( '1.23' );
// Add tab messages to the init init module
foreach ( $wgVisualEditorTabMessages as $msg ) {

View file

@ -6,12 +6,20 @@
*/
.ve-init-mw-viewPageTarget-surface {
/*
In order to allow placing the text cursor to the start or end of the text by
clicking in the margin area, we expand the outer boundary of the surface
outside the parent container using negative margin. Then we shrink the visible
rendering by applying inner padding. The end result is that the content is
the same width as in read mode, except with the padding around it now being
part of it instead of its parent, thus making it treat the area as part
of content editable.
*/
margin: 0.8em -1.5em 0 -1.5em;
}
.ve-init-mw-viewPageTarget-surface .ve-ce-documentNode {
font-size: 0.8em;
padding: 0 1.875em; /* 1.5/0.8 */
padding: 0 1.5em;
}
.ve-init-mw-viewPageTarget-surface .oo-ui-menuWidget {

View file

@ -1315,6 +1315,7 @@ ve.init.mw.Target.prototype.setUpSurface = function ( doc, callback ) {
setTimeout( function () {
// Initialize surface
target.surface.getContext().hide();
target.surface.$element.addClass( 'mw-body-content' );
target.$document = target.surface.$element.find( '.ve-ce-documentNode' );
target.$element.append( target.surface.$element );
target.setUpToolbar();