Property changes on: branches/wmf-deployment/extensions/LiquidThreads/jquery/js2.combined.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
1 | 1 | - /trunk/extensions/LiquidThreads/jquery/js2.combined.js:57390,59879,59883,59885-59886 |
2 | 2 | + /trunk/extensions/LiquidThreads/jquery/js2.combined.js:57390,59879,59883,59885-59886,61563 |
Index: branches/wmf-deployment/extensions/LiquidThreads/lqt.js |
— | — | @@ -612,20 +612,34 @@ |
613 | 613 | |
614 | 614 | // Update thread-level menu, if appropriate |
615 | 615 | if ( $j(threadWrapper).hasClass( 'lqt-thread-topmost' ) ) { |
| 616 | + // To perform better, check the 3 elements before the top-level thread container before |
| 617 | + // scanning the whole document |
| 618 | + var menu = undefined; |
616 | 619 | var threadLevelCommandSelector = '#lqt-threadlevel-commands-'+threadId; |
| 620 | + var traverseElement = $j(threadWrapper); |
617 | 621 | |
618 | | - var menu = $j(threadLevelCommandSelector); |
| 622 | + for( i=0;i<3 && typeof menu == 'undefined';++i ) { |
| 623 | + traverseElement = traverseElement.prev(); |
| 624 | + if ( traverseElement.is(threadLevelCommandSelector) ) { |
| 625 | + menu = traverseElement |
| 626 | + } |
| 627 | + } |
| 628 | + |
| 629 | + if ( typeof menu == 'undefined' ) { |
| 630 | + menu = $j(threadLevelCommandSelector); |
| 631 | + } |
| 632 | + |
619 | 633 | liquidThreads.setupThreadMenu( menu, threadId ); |
620 | 634 | } |
621 | 635 | |
622 | 636 | // Check for a "show replies" button |
623 | | - $j('a.lqt-show-replies').click( liquidThreads.showReplies ); |
| 637 | + $j(threadContainer).find('a.lqt-show-replies').click( liquidThreads.showReplies ); |
624 | 638 | |
625 | 639 | // "Show more posts" link |
626 | | - $j('a.lqt-show-more-posts').click( liquidThreads.showMore ); |
| 640 | + $j(threadContainer).find('a.lqt-show-more-posts').click( liquidThreads.showMore ); |
627 | 641 | |
628 | 642 | // Handler for "Link to this" button |
629 | | - $j('.lqt-command-link').click( liquidThreads.showLinkWindow ); |
| 643 | + $j(threadContainer).find('.lqt-command-link').click( liquidThreads.showLinkWindow ); |
630 | 644 | }, |
631 | 645 | |
632 | 646 | 'showReplies' : function(e) { |
Property changes on: branches/wmf-deployment/extensions/LiquidThreads |
___________________________________________________________________ |
Name: svn:mergeinfo |
633 | 647 | - /trunk/extensions/LiquidThreads:57390,58990-59196,59198-59661,59666-59743,59782-59877,59879,59883,59885-59886 |
634 | 648 | + /trunk/extensions/LiquidThreads:57390,58990-59196,59198-59661,59666-59743,59782-59877,59879,59883,59885-59886,61563 |