mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Merge "mw.ViewPageTarget: Use .mw-body-content for content styling"
This commit is contained in:
commit
da577b21d5
|
@ -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 ) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue