mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Fixed some display issues
This commit is contained in:
parent
68c5487c61
commit
d926cc7165
|
@ -85,6 +85,22 @@
|
||||||
padding: 0.33em 0;
|
padding: 0.33em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.es-contextView-position-above .es-contextView-menu {
|
||||||
|
bottom: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.es-contextView-position-below .es-contextView-menu {
|
||||||
|
top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.es-contextView-position-left .es-contextView-menu {
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.es-contextView-position-right .es-contextView-menu {
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.es-contextView-menuItem {
|
.es-contextView-menuItem {
|
||||||
padding: 0.33em 1em;
|
padding: 0.33em 1em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@ -137,14 +153,6 @@
|
||||||
background-color: #b3d6f6;
|
background-color: #b3d6f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.es-contextView-position-above .es-contextView-menu {
|
|
||||||
bottom: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.es-contextView-position-below .es-contextView-menu {
|
|
||||||
top: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.es-contentView {
|
.es-contentView {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|
|
@ -246,12 +246,14 @@ es.ContentView.prototype.drawSelection = function( range ) {
|
||||||
'width': contentWidth - fromPosition.left,
|
'width': contentWidth - fromPosition.left,
|
||||||
'height': fromPosition.bottom - fromPosition.top
|
'height': fromPosition.bottom - fromPosition.top
|
||||||
} ).show();
|
} ).show();
|
||||||
this.$rangeEnd.css( {
|
if ( toPosition.left ) {
|
||||||
'top': toPosition.top,
|
this.$rangeEnd.css( {
|
||||||
'left': 0,
|
'top': toPosition.top,
|
||||||
'width': toPosition.left,
|
'left': 0,
|
||||||
'height': toPosition.bottom - toPosition.top
|
'width': toPosition.left,
|
||||||
} ).show();
|
'height': toPosition.bottom - toPosition.top
|
||||||
|
} ).show();
|
||||||
|
}
|
||||||
if ( fromLineIndex + 1 < toLineIndex ) {
|
if ( fromLineIndex + 1 < toLineIndex ) {
|
||||||
this.$rangeFill.css( {
|
this.$rangeFill.css( {
|
||||||
'top': fromPosition.bottom,
|
'top': fromPosition.bottom,
|
||||||
|
|
|
@ -37,7 +37,10 @@ es.ContextView = function( surfaceView, $overlay ) {
|
||||||
/* Methods */
|
/* Methods */
|
||||||
|
|
||||||
es.ContextView.prototype.set = function() {
|
es.ContextView.prototype.set = function() {
|
||||||
this.$.removeClass( 'es-contextView-position-below es-contextView-position-above' );
|
this.$.removeClass(
|
||||||
|
'es-contextView-position-below es-contextView-position-above ' +
|
||||||
|
'es-contextView-position-left es-contextView-position-right'
|
||||||
|
);
|
||||||
var selection = this.surfaceView.getModel().getSelection(),
|
var selection = this.surfaceView.getModel().getSelection(),
|
||||||
position,
|
position,
|
||||||
offset,
|
offset,
|
||||||
|
@ -60,6 +63,11 @@ es.ContextView.prototype.set = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( position ) {
|
if ( position ) {
|
||||||
|
if ( position.left + this.$menu.width() < $( 'body' ).width() ) {
|
||||||
|
this.$.addClass( 'es-contextView-position-left' );
|
||||||
|
} else {
|
||||||
|
this.$.addClass( 'es-contextView-position-right' );
|
||||||
|
}
|
||||||
this.$.css( { 'left': position.left, 'top': position.top } );
|
this.$.css( { 'left': position.left, 'top': position.top } );
|
||||||
this.$icon.fadeIn( 'fast' );
|
this.$icon.fadeIn( 'fast' );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue