diff --git a/js/admin-products.js b/js/admin-products.js index adbb9386e..0e05d87b9 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -291,17 +291,13 @@ function getManufacturers() function disableSave() { - if ($('#product-tab-content-Associations').hasClass('not-loaded')) - { $('#desc-product-save').hide(); $('#desc-product-save-and-stay').hide(); - - $('#product-tab-content-Associations').bind('loaded', function() - { - $('#desc-product-save').show(); - $('#desc-product-save-and-stay').show(); - }); - } +} +function enableSave() +{ + $('#desc-product-save').show(); + $('#desc-product-save-and-stay').show(); } /* function autocomplete */ @@ -310,5 +306,13 @@ urlToCall = null; $(document).ready(function() { updateCurrentText(); updateFriendlyURL(); - disableSave(); -}); \ No newline at end of file + + // disable save if Associations tab is not loaded + if ($('#product-tab-content-Associations').hasClass('not-loaded')) + disableSave(); + + $('#product-tab-content-Associations').bind('loaded', function() + { + enableSave(); + }); +});