Index: trunk/extensions/Narayam/js/ext.narayam.core.js |
— | — | @@ -455,13 +455,9 @@ |
456 | 456 | $li |
457 | 457 | .append( $menu ); |
458 | 458 | |
459 | | - // If rtl, add to the right of top personal links, else, to the left |
460 | | - if($('body').is( '.rtl' ) ){ |
461 | | - $($('#p-personal ul')[0]).append( $li ); |
462 | | - } |
463 | | - else{ |
464 | | - $($('#p-personal ul')[0]).prepend( $li ); |
465 | | - } |
| 459 | + //if rtl, add to the right of top personal links. Else, to the left |
| 460 | + var fn = $('body').hasClass( 'rtl' ) ? "append" : "prepend"; |
| 461 | + $('#p-personal ul:first')[fn]( $li ); |
466 | 462 | |
467 | 463 | // Build enable/disable checkbox and label |
468 | 464 | $checkbox = $( '<input type="checkbox" id="narayam-toggle" />' ); |