Browse Source

I'm not a js expert, but I think it looks better with the function outside the onready

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

+ 18 - 18
Themes/default/scripts/icondropdown.js

@@ -13,22 +13,22 @@ $(document).ready(function()
 	
 	$('#icon_image_input').change(function ()
 	{
-		refreshPreview();
+		refreshIconPreview();
 	});
-	
-	function refreshPreview()
-	{
-		// Get the icon count element.
-		var icon_count = $('#icon_count_input');
-		var select_box = $('select#icon_image_input').val();
-	
-		// If it's empty, set it to 1.
-		if (icon_count.val() == 0 && select_box != 'blank.png')
-			icon_count.val(1);
-	
-		// Update the icon preview.
-		$('#icon_preview').attr('src', smf_default_theme_url + '/images/membericons/' + select_box);
-	}
-	
-	refreshPreview();
-});
+
+	refreshIconPreview();
+});
+
+function refreshIconPreview()
+{
+	// Get the icon count element.
+	var icon_count = $('#icon_count_input');
+	var select_box = $('select#icon_image_input').val();
+
+	// If it's empty, set it to 1.
+	if (icon_count.val() == 0 && select_box != 'blank.png')
+		icon_count.val(1);
+
+	// Update the icon preview.
+	$('#icon_preview').attr('src', smf_default_theme_url + '/images/membericons/' + select_box);
+}