r77910 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77909‎ | r77910 | r77911 >
Date:21:02, 6 December 2010
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Added center option - will pass this upstream.
Modified paths:
  • /trunk/phase3/resources/jquery.tipsy/jquery.tipsy.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/jquery.tipsy/jquery.tipsy.js
@@ -56,9 +56,17 @@
5757
5858 if (gravity.length == 2) {
5959 if (gravity.charAt(1) == 'w') {
60 - tp.left = pos.left + pos.width / 2 - 15;
 60+ if ( this.options.center ) {
 61+ tp.left = pos.left + pos.width / 2 - 15;
 62+ } else {
 63+ tp.left = pos.left;
 64+ }
6165 } else {
62 - tp.left = pos.left + pos.width / 2 - actualWidth + 15;
 66+ if ( this.options.center ) {
 67+ tp.left = pos.left + pos.width / 2 - actualWidth + 15;
 68+ } else {
 69+ tp.left = pos.left + pos.width;
 70+ }
6371 }
6472 }
6573
@@ -171,6 +179,7 @@
172180 fade: true,
173181 fallback: '',
174182 gravity: 'n',
 183+ center: true,
175184 html: false,
176185 live: false,
177186 offset: 0,

Comments

#Comment by Catrope (talk | contribs)   18:47, 8 December 2010
-                        tp.left = pos.left + pos.width / 2 - actualWidth + 15;
+                    	if ( this.options.center ) {
+                    		tp.left = pos.left + pos.width / 2 - actualWidth + 15;
+                    	} else {
+                    		tp.left = pos.left + pos.width;
+                    	}

This changes the indentation from 4 spaces to 3 spaces (?!), and uses a tab to indent the tp.left lines. I hate using spaces for indentation with a passion and would've converted this file to using tabs already if it weren't an external library, but you should still be consistent and follow the existing style.

#Comment by Trevor Parscal (WMF) (talk | contribs)   19:15, 8 December 2010

See r78084 for the fix

Status & tagging log