mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
PHRAS-147 Fix javascript issue for suggested values
This commit is contained in:
@@ -427,23 +427,24 @@ function desactiv4VS()
|
|||||||
|
|
||||||
if( o2.length > 0 )
|
if( o2.length > 0 )
|
||||||
{
|
{
|
||||||
var optionLength = o2.find("options").length;
|
var optionLength = o2.find("option").length;
|
||||||
if ( optionLength > 1) {
|
var index = o2.prop("selectedIndex");
|
||||||
|
|
||||||
if ((o2.prop("selectedIndex")+1) != optionLength) {
|
if ( optionLength > 1) {
|
||||||
|
if ((index+1) == optionLength) {
|
||||||
activer_bout('bout_desc',false);
|
activer_bout('bout_desc',false);
|
||||||
} else {
|
} else {
|
||||||
activer_bout('bout_desc',true);
|
activer_bout('bout_desc',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o2.prop("selectedIndex")!=0 && optionLength>1) {
|
if (index == 0 && optionLength>1) {
|
||||||
activer_bout('bout_mont',false);
|
activer_bout('bout_mont',false);
|
||||||
} else {
|
} else {
|
||||||
activer_bout('bout_mont',true);
|
activer_bout('bout_mont',true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
activer_bout('bout_desc',true);
|
activer_bout('bout_desc',false);
|
||||||
activer_bout('bout_mont',true);
|
activer_bout('bout_mont',false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -461,7 +462,7 @@ function activ4VS()
|
|||||||
}
|
}
|
||||||
|
|
||||||
desactiv4VS();
|
desactiv4VS();
|
||||||
activer_bout('bout_supp',false);
|
activer_bout('bout_supp',true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// supprime une valsug
|
// supprime une valsug
|
||||||
@@ -516,7 +517,7 @@ function supprimer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(o2.prop("selectedIndex")<0) {
|
if(o2.prop("selectedIndex")<0) {
|
||||||
activer_bout('bout_supp',true);
|
activer_bout('bout_supp',false);
|
||||||
}
|
}
|
||||||
|
|
||||||
desactiv4VS();
|
desactiv4VS();
|
||||||
@@ -766,7 +767,11 @@ function activer_bout(idBout,val)
|
|||||||
o = $("#"+idBout);
|
o = $("#"+idBout);
|
||||||
|
|
||||||
if( o.length > 0 ) {
|
if( o.length > 0 ) {
|
||||||
o.attr("disabled", val);
|
if (!val) {
|
||||||
|
o.attr("disabled", true);
|
||||||
|
} else {
|
||||||
|
o.removeAttr("disabled");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user