parent
06bb72d24f
commit
1979a7fc7f
@ -21,7 +21,7 @@ var candidateLabels = $A(allLabels).select(function(candidateLabel){
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (candidateLabels.length == 0) {
|
if (candidateLabels.length == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//reverse length sort
|
//reverse length sort
|
||||||
@ -30,7 +30,7 @@ candidateLabels = candidateLabels.sortBy(function(s) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var locatedLabel = candidateLabels.first();
|
var locatedLabel = candidateLabels.first();
|
||||||
var labelFor = locatedLabel.getAttribute('for');
|
var labelFor = locatedLabel.getAttribute('for') || locatedLabel.htmlFor;
|
||||||
|
|
||||||
if ((labelFor == null) && (locatedLabel.hasChildNodes())) {
|
if ((labelFor == null) && (locatedLabel.hasChildNodes())) {
|
||||||
return locatedLabel.getElementsByTagName('button')[0]
|
return locatedLabel.getElementsByTagName('button')[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user