r104638 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104637‎ | r104638 | r104639 >
Date:00:48, 30 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed some display issues
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/es.Surface.css (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/views/es.ContentView.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/es.Surface.css
@@ -85,6 +85,22 @@
8686 padding: 0.33em 0;
8787 }
8888
 89+.es-contextView-position-above .es-contextView-menu {
 90+ bottom: 7px;
 91+}
 92+
 93+.es-contextView-position-below .es-contextView-menu {
 94+ top: 8px;
 95+}
 96+
 97+.es-contextView-position-left .es-contextView-menu {
 98+ left: 0;
 99+}
 100+
 101+.es-contextView-position-right .es-contextView-menu {
 102+ right: 0;
 103+}
 104+
89105 .es-contextView-menuItem {
90106 padding: 0.33em 1em;
91107 cursor: pointer;
@@ -137,14 +153,6 @@
138154 background-color: #b3d6f6;
139155 }
140156
141 -.es-contextView-position-above .es-contextView-menu {
142 - bottom: 7px;
143 -}
144 -
145 -.es-contextView-position-below .es-contextView-menu {
146 - top: 8px;
147 -}
148 -
149157 .es-contentView {
150158 position: relative;
151159 z-index: 1;
Index: trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js
@@ -37,7 +37,10 @@
3838 /* Methods */
3939
4040 es.ContextView.prototype.set = function() {
41 - this.$.removeClass( 'es-contextView-position-below es-contextView-position-above' );
 41+ this.$.removeClass(
 42+ 'es-contextView-position-below es-contextView-position-above ' +
 43+ 'es-contextView-position-left es-contextView-position-right'
 44+ );
4245 var selection = this.surfaceView.getModel().getSelection(),
4346 position,
4447 offset,
@@ -60,6 +63,11 @@
6164 }
6265 }
6366 if ( position ) {
 67+ if ( position.left + this.$menu.width() < $( 'body' ).width() ) {
 68+ this.$.addClass( 'es-contextView-position-left' );
 69+ } else {
 70+ this.$.addClass( 'es-contextView-position-right' );
 71+ }
6472 this.$.css( { 'left': position.left, 'top': position.top } );
6573 this.$icon.fadeIn( 'fast' );
6674 }
Index: trunk/extensions/VisualEditor/modules/es/views/es.ContentView.js
@@ -246,12 +246,14 @@
247247 'width': contentWidth - fromPosition.left,
248248 'height': fromPosition.bottom - fromPosition.top
249249 } ).show();
250 - this.$rangeEnd.css( {
251 - 'top': toPosition.top,
252 - 'left': 0,
253 - 'width': toPosition.left,
254 - 'height': toPosition.bottom - toPosition.top
255 - } ).show();
 250+ if ( toPosition.left ) {
 251+ this.$rangeEnd.css( {
 252+ 'top': toPosition.top,
 253+ 'left': 0,
 254+ 'width': toPosition.left,
 255+ 'height': toPosition.bottom - toPosition.top
 256+ } ).show();
 257+ }
256258 if ( fromLineIndex + 1 < toLineIndex ) {
257259 this.$rangeFill.css( {
258260 'top': fromPosition.bottom,

Status & tagging log