Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.history.js |
— | — | @@ -57,17 +57,21 @@ |
58 | 58 | if ( !$buttons.length ) { |
59 | 59 | return false; |
60 | 60 | } |
61 | | - |
62 | | - var buttonText = $buttons.remove().first().val(), |
63 | | - $compareLink = $( '<a></a>', { |
| 61 | + var copyAttrs = ['title', 'accesskey']; |
| 62 | + $buttons.each(function() { |
| 63 | + var $button = $(this), |
| 64 | + $compareLink= $( '<a></a>', { |
64 | 65 | 'class': 'compare-link', |
65 | | - 'text': buttonText |
| 66 | + 'text': $button.val() |
66 | 67 | }).button(); |
67 | | - $histForm.prepend( $compareLink ); |
68 | | - if ( $buttons.length == 2 ) { |
69 | | - $histForm.append( $compareLink.clone() ); |
70 | | - } |
71 | | - |
| 68 | + $.each(copyAttrs, function(i, name) { |
| 69 | + var val = $button.attr(name); |
| 70 | + if (val) { |
| 71 | + $compareLink.attr(name, val); |
| 72 | + } |
| 73 | + }); |
| 74 | + $button.replaceWith($compareLink); |
| 75 | + }); |
72 | 76 | var updateCompare = function() { |
73 | 77 | var $radio = $histForm.find( 'input[type=radio]:checked' ); |
74 | 78 | var genLink = mw.config.get( 'wgScript' ) |