From 8d0cc301d78178f0fc7079b186ee82511e2da736 Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Tue, 31 Jan 2012 15:03:05 +0000 Subject: [PATCH] // Fix Bug with adding attribute values when attribute type is pre-selected to a color option --- .../default/template/controllers/attributes/form.tpl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/attributes/form.tpl b/admin-dev/themes/default/template/controllers/attributes/form.tpl index ed197e63f..3e18f9ba2 100644 --- a/admin-dev/themes/default/template/controllers/attributes/form.tpl +++ b/admin-dev/themes/default/template/controllers/attributes/form.tpl @@ -48,11 +48,17 @@ {block name="script"} var attributesGroups = {ldelim}{$strAttributesGroups}{rdelim}; - $('#id_attribute_group').change(function() { - var val = $(this).val(); + + var displayColorFieldsOption = function() { + var val = $('#id_attribute_group').val(); if (attributesGroups[val]) $('#colorAttributeProperties').show(); else $('#colorAttributeProperties').hide(); - }); + }; + + displayColorFieldsOption(); + + $('#id_attribute_group').change(displayColorFieldsOption); + {/block}