Index: trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js |
— | — | @@ -48,7 +48,8 @@ |
49 | 49 | |
50 | 50 | $.ajax({ |
51 | 51 | type: 'get', |
52 | | - url: mw.util.wikiScript('api') + '?' + Math.random(Date.now), // added randomness to prevent ie7 cache |
| 52 | + url: mw.util.wikiScript('api'), |
| 53 | + cache: false, |
53 | 54 | data: request, |
54 | 55 | success: function( data ) { |
55 | 56 | |
— | — | @@ -71,8 +72,9 @@ |
72 | 73 | /* |
73 | 74 | * API call to mark or unmark an item as helpful. |
74 | 75 | */ |
75 | | - markItem: function( $item, action ) { |
76 | | - var props = mah.getItemProperties( $item ), |
| 76 | + markItem: function( $clicked, action ) { |
| 77 | + var $item = $clicked.parent().parent(), |
| 78 | + props = mah.getItemProperties( $item ), |
77 | 79 | clientData = $.client.profile(), |
78 | 80 | request; |
79 | 81 | props.mahaction = action; |
— | — | @@ -104,18 +106,16 @@ |
105 | 107 | * Click Event for marking an item as helpful. |
106 | 108 | */ |
107 | 109 | $( '.markashelpful-mark' ).live( 'click', function() { |
108 | | - var $item = $( this ).parent().parent(); |
109 | | - mah.markItem( $item, 'mark' ); |
| 110 | + mah.markItem( $(this), 'mark' ); |
110 | 111 | } ); |
111 | 112 | |
112 | 113 | /* |
113 | 114 | * Click Event for removing helpful status from an item. |
114 | 115 | */ |
115 | 116 | $( '.markashelpful-undo' ).live( 'click', function() { |
116 | | - var $item = $( this ).parent().parent(); |
117 | | - mah.markItem( $item, 'unmark' ); |
| 117 | + mah.markItem( $(this), 'unmark' ); |
118 | 118 | } ); |
119 | 119 | |
120 | 120 | // Initialize MarkAsHelpful |
121 | 121 | $( mah.init ); |
122 | | -} ) ( jQuery ); |
| 122 | +} ) ( jQuery ); |
\ No newline at end of file |