// Default category was not selected
This commit is contained in:
+40
@@ -38,6 +38,14 @@
|
|||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
$(this).prop("checked", true);
|
$(this).prop("checked", true);
|
||||||
|
|
||||||
|
$('select#id_category_default').append('<option value="'+$(this).val()+'">'+($(this).val() !=1 ? $(this).parent().find('label').html() : home)+'</option>');
|
||||||
|
if ($('select#id_category_default option').length > 0)
|
||||||
|
{
|
||||||
|
$('select#id_category_default').closest('.form-group').show();
|
||||||
|
$('#no_default_category').hide();
|
||||||
|
}
|
||||||
|
|
||||||
$(this).parent().addClass("tree-selected");
|
$(this).parent().addClass("tree-selected");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -49,6 +57,14 @@
|
|||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
$(this).prop("checked", false);
|
$(this).prop("checked", false);
|
||||||
|
|
||||||
|
$('select#id_category_default option[value='+$(this).val()+']').remove();
|
||||||
|
if ($('select#id_category_default option').length == 0)
|
||||||
|
{
|
||||||
|
$('select#id_category_default').closest('.form-group').hide();
|
||||||
|
$('#no_default_category').show();
|
||||||
|
}
|
||||||
|
|
||||||
$(this).parent().removeClass("tree-selected");
|
$(this).parent().removeClass("tree-selected");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -112,5 +128,29 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
$("#{$id}").find(":input[type=checkbox]").click(
|
||||||
|
function()
|
||||||
|
{
|
||||||
|
if ($(this).prop("checked"))
|
||||||
|
{
|
||||||
|
$('select#id_category_default').append('<option value="'+$(this).val()+'">'+($(this).val() !=1 ? $(this).parent().find('label').html() : home)+'</option>');
|
||||||
|
if ($('select#id_category_default option').length > 0)
|
||||||
|
{
|
||||||
|
$('select#id_category_default').closest('.form-group').show();
|
||||||
|
$('#no_default_category').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('select#id_category_default option[value='+$(this).val()+']').remove();
|
||||||
|
if ($('select#id_category_default option').length == 0)
|
||||||
|
{
|
||||||
|
$('select#id_category_default').closest('.form-group').hide();
|
||||||
|
$('#no_default_category').show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -23,9 +23,9 @@
|
|||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}">
|
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}">
|
||||||
<label class="tree-item-name">
|
<span class="tree-item-name{if isset($node['disabled']) && $node['disabled'] == true} tree-item-name-disable{/if}">
|
||||||
<input type="checkbox" name="categoryBox[]" value="{$node['id_category']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
<input type="checkbox" name="categoryBox[]" value="{$node['id_category']}"{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
|
||||||
<i class="tree-dot"></i>
|
<i class="tree-dot"></i>
|
||||||
{$node['name']}
|
<label class="tree-toggler">{$node['name']}</label>
|
||||||
</label>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
Reference in New Issue
Block a user