// improvement about admin-products.js enable/disable save buttons

This commit is contained in:
mMarinetti
2012-01-04 10:30:21 +00:00
parent 60adf0135d
commit 8e30700eb0
+15 -11
View File
@@ -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();
});
// 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();
});
});