Browse Source

Fixed quick moderation javascript, thanks Antes for pointing me at some ugly code (I wrote it, so I can call it ugly :P)

Signed-off-by: emanuele <[email protected]>
emanuele 12 years ago
parent
commit
a0ae30cc70
1 changed files with 2 additions and 13 deletions
  1. 2 13
      Themes/default/scripts/theme.js

+ 2 - 13
Themes/default/scripts/theme.js

@@ -60,20 +60,9 @@ addLoadEvent(smc_toggleImageDimensions);
 
 function smf_addButton(stripId, image, options)
 {
-	var strip = $('#' + stripId);
-	var anchorItems = $('#' + stripId + '.span');
+	$('#' + stripId + ' ul li').last().removeClass("last");
 
-	// Kill the class name "last" in the last item.
-	if (anchorItems.length > 0)
-	{
-		var lastSpan = anchorItems[anchorItems.length - 1];
-		var lastSpanClass = $(lastSpan).attr('class');
-		$(lastSpan).attr('class') = lastSpanClass.replace(/\s*last/, 'position_holder');
-	}
-
-	// Add in the new button!
-	var buttonStrip = strip.children('ul');
-	buttonStrip.append(
+	$('#' + stripId + ' ul').append(
 		'<li' + ('sId' in options ? ' id="' + options.sId + '"' : '') + '>' +
 			'<a href="' + options.sUrl + '"' + ('sCustom' in options ? options.sCustom : '') + '>' +
 				'<span class="last"' + ('sId' in options ? ' id="' + options.sId + '_text"' : '') + '>' + options.sText + '</span>' +