http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96185

Revision: 96185
Author:   santhosh
Date:     2011-09-03 13:55:07 +0000 (Sat, 03 Sep 2011)
Log Message:
-----------
Use hasClass instead of .is . And small cleanup of the code with oneliner.

Modified Paths:
--------------
    trunk/extensions/Narayam/js/ext.narayam.core.js

Modified: trunk/extensions/Narayam/js/ext.narayam.core.js
===================================================================
--- trunk/extensions/Narayam/js/ext.narayam.core.js     2011-09-03 13:52:53 UTC 
(rev 96184)
+++ trunk/extensions/Narayam/js/ext.narayam.core.js     2011-09-03 13:55:07 UTC 
(rev 96185)
@@ -455,13 +455,9 @@
                $li
                        .append( $menu );
                        
-               // If rtl, add to the right of top personal links, else, to the 
left
-               if($('body').is( '.rtl' ) ){
-                       $($('#p-personal ul')[0]).append( $li );
-               }
-               else{
-                       $($('#p-personal ul')[0]).prepend( $li );
-               }
+               //if rtl, add to the right of top personal links. Else, to the 
left
+               var fn = $('body').hasClass( 'rtl' ) ? "append" : "prepend";
+               $('#p-personal ul:first')[fn]( $li );
                
                // Build enable/disable checkbox and label
                $checkbox = $( '<input type="checkbox" id="narayam-toggle" />' 
);


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to