fixed #10142: Matrix 2.0 - Search screen compare button not functional
This commit is contained in:
parent
234914c3e2
commit
4086723a70
3 changed files with 10 additions and 10 deletions
|
|
@ -10,7 +10,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
if(typeof(oRecord.getData("checked")) != 'undefined' && oRecord.getData("checked") == 'checked'){
|
||||
innerHTML = innerHTML + " checked='checked'";
|
||||
}
|
||||
innerHTML = innerHTML + " onchange='javascript:compareFormButton()' class='compareCheckBox'>";
|
||||
innerHTML = innerHTML + " class='compareCheckBox'>";
|
||||
elCell.innerHTML = innerHTML;
|
||||
};
|
||||
|
||||
|
|
@ -72,12 +72,8 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
attributeSelects[i].onchange = reloadCompareForm;
|
||||
}
|
||||
|
||||
var btnCompare = new YAHOO.widget.Button("compare",{disabled:true,id:"compareButton"});
|
||||
var btnCompare = new YAHOO.widget.Button("compare",{id:"compareButton"});
|
||||
btnCompare.on("click", function(e) {
|
||||
window.document.forms['doCompare'].submit();
|
||||
},this,true);
|
||||
|
||||
window.compareFormButton = function() {
|
||||
var compareCheckBoxes = YAHOO.util.Dom.getElementsByClassName('compareCheckBox','input');
|
||||
var checked = 0;
|
||||
for (var i = compareCheckBoxes.length; i--; ) {
|
||||
|
|
@ -85,12 +81,15 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
checked++;
|
||||
}
|
||||
}
|
||||
if (checked > 1 && checked < maxComparisons){
|
||||
btnCompare.set("disabled",false);
|
||||
if (checked < 2){
|
||||
alert(tooFewMessage);
|
||||
}else if (checked > maxComparisons){
|
||||
alert(tooManyMessage);
|
||||
}else{
|
||||
btnCompare.set("disabled",true);
|
||||
window.document.forms['doCompare'].submit();
|
||||
}
|
||||
}
|
||||
},this,true);
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue