// improve JS (select/unselect all)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9130 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2011-10-07 12:29:51 +00:00
parent 0e494ed7db
commit 6749d55e54
+8 -2
View File
@@ -229,27 +229,33 @@ class AdminGroups extends AdminTab
$(this).attr("selected", "selected");
});
});
select1 = true;
select2 = true;
$(\'#selectAll1\').click(function() {
if ($(\'#selectRestrictions1 option:selected\').size() != $(\'#selectRestrictions1 option\').size())
if (select1)
{
select2 = false;
$(\'#selectRestrictions1 option\').attr(\'selected\', \'selected\');
$(this).text(\''.$this->l('Unselect All', get_class($this), false, false).'\');
}
else
{
select2 = true;
$(\'#selectRestrictions1 option\').removeAttr(\'selected\');
$(this).text(\''.$this->l('Select All', get_class($this), false, false).'\');
}
return false;
});
$(\'#selectAll2\').click(function() {
if ($(\'#selectRestrictions2 option:selected\').size() != $(\'#selectRestrictions2 option\').size())
if (select2)
{
select2 = false;
$(\'#selectRestrictions2 option\').attr(\'selected\', \'selected\');
$(this).text(\''.$this->l('Unselect All', get_class($this), false, false).'\');
}
else
{
select2 = true;
$(\'#selectRestrictions2 option\').removeAttr(\'selected\');
$(this).text(\''.$this->l('Select All', get_class($this), false, false).'\');
}