Property changes on: branches/wmf-deployment/extensions/LiquidThreads_alpha/jquery/js2.combined.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
1 | 1 | - /trunk/extensions/LiquidThreads/jquery/js2.combined.js:57390,59879,59883,59885-60124 |
2 | 2 | + /trunk/extensions/LiquidThreads/jquery/js2.combined.js:57390,59879,59883,59885-60124,61563 |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.js |
— | — | @@ -647,20 +647,34 @@ |
648 | 648 | |
649 | 649 | // Update thread-level menu, if appropriate |
650 | 650 | if ( $j(threadWrapper).hasClass( 'lqt-thread-topmost' ) ) { |
| 651 | + // To perform better, check the 3 elements before the top-level thread container before |
| 652 | + // scanning the whole document |
| 653 | + var menu = undefined; |
651 | 654 | var threadLevelCommandSelector = '#lqt-threadlevel-commands-'+threadId; |
| 655 | + var traverseElement = $j(threadWrapper); |
652 | 656 | |
653 | | - var menu = $j(threadLevelCommandSelector); |
| 657 | + for( i=0;i<3 && typeof menu == 'undefined';++i ) { |
| 658 | + traverseElement = traverseElement.prev(); |
| 659 | + if ( traverseElement.is(threadLevelCommandSelector) ) { |
| 660 | + menu = traverseElement |
| 661 | + } |
| 662 | + } |
| 663 | + |
| 664 | + if ( typeof menu == 'undefined' ) { |
| 665 | + menu = $j(threadLevelCommandSelector); |
| 666 | + } |
| 667 | + |
654 | 668 | liquidThreads.setupThreadMenu( menu, threadId ); |
655 | 669 | } |
656 | 670 | |
657 | 671 | // Check for a "show replies" button |
658 | | - $j('a.lqt-show-replies').click( liquidThreads.showReplies ); |
| 672 | + $j(threadContainer).find('a.lqt-show-replies').click( liquidThreads.showReplies ); |
659 | 673 | |
660 | 674 | // "Show more posts" link |
661 | | - $j('a.lqt-show-more-posts').click( liquidThreads.showMore ); |
| 675 | + $j(threadContainer).find('a.lqt-show-more-posts').click( liquidThreads.showMore ); |
662 | 676 | |
663 | 677 | // Handler for "Link to this" button |
664 | | - $j('.lqt-command-link').click( liquidThreads.showLinkWindow ); |
| 678 | + $j(threadContainer).find('.lqt-command-link').click( liquidThreads.showLinkWindow ); |
665 | 679 | }, |
666 | 680 | |
667 | 681 | 'showReplies' : function(e) { |
Property changes on: branches/wmf-deployment/extensions/LiquidThreads_alpha |
___________________________________________________________________ |
Name: svn:mergeinfo |
668 | 682 | - /trunk/extensions/LiquidThreads:57390,58990-59196,59198-59661,59666-59743,59782-59877,59879,59883,59885-60124 |
669 | 683 | + /trunk/extensions/LiquidThreads:57390,58990-59196,59198-59661,59666-59743,59782-59877,59879,59883,59885-60124,61563 |