// BO : product form improved (categories association)

This commit is contained in:
vChabot
2012-04-19 16:18:58 +00:00
parent 925406d026
commit 9b2f0d9ed3
5 changed files with 24 additions and 18 deletions
+13 -4
View File
@@ -35,15 +35,15 @@ var id_category_root = 0;
function buildTreeView()
{
use_shop_context = false;
use_shop_context = 0;
if (buildTreeView.arguments[0])
use_shop_context = true;
use_shop_context = 1;
$("#categories-treeview").treeview({
url : 'ajax.php',
toggle: function () { callbackToggle($(this)); },
ajax : {
type: 'POST',
async: true,
async: false,
data: {
getChildrenCategories : true,
use_shop_context : use_shop_context,
@@ -57,7 +57,10 @@ function buildTreeView()
$('#categories-treeview li#'+id_category_root).
removeClass('collapsable lastCollapsable').
addClass('last static');
disabled = $('#categories-treeview li:first input[type=checkbox]').attr('disabled');
$('#categories-treeview input[type=checkbox]').attr('disabled', disabled);
$('#expand_all').click( function () {
expandAllCategories();
return false;
@@ -79,6 +82,12 @@ function buildTreeView()
uncheckAllCategories();
return false;
});
// check if checkboxes need to be disabled or not
$('.expandable').click(function(){
disabled = $('#categories-treeview li:first input[type=checkbox]').attr('disabled');
$('#categories-treeview input[type=checkbox]').attr('disabled', disabled);
});
}
function callbackToggle(element)
+5
View File
@@ -1500,6 +1500,10 @@ function multishopCheckProductField(checked, id, type)
$('#unity').attr('disabled', checked);
break;
case 'category_box' :
$('#categories-treeview input[type=checkbox]').attr('disabled', checked);
break;
default :
$('#'+id).attr('disabled', checked);
break;
@@ -1545,6 +1549,7 @@ function multishopCheckAllProductFieldsSeo(checked)
function multishopCheckAllProductFieldsAssociations(checked)
{
multishopCheckProductField($('input[name=\'multishop_check[id_category_default]\']').attr('checked'), 'id_category_default');
multishopCheckProductField($('input[name=\'multishop_check[category_box]\']').attr('checked'), 'categories-treeview', 'category_box');
}
var tabs_manager = new ProductTabsManager();