Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_setCount: function(responseObject) {
if ((typeof(responseObject) != "undefined") && (responseObject != null)) {
var oCart = responseObject.cart;
if ((typeof(oCart) != "undefined") && (oCart != null)) {
this.approximateSize = oCart.size;
var bFull = (this.approximateSize >= this.maxItems);
var sTip = this.i18n["catalog.cart.check.tip"];
var sFullTip = this.i18n["catalog.cart.isfull"];
sFullTip = sFullTip.replace("{0}",""+this.maxItems);
dojo.query(".gptCartCheckControl").forEach(function(item) {
dojo.query(".gptCartCheckBox",item).forEach(function(item2) {
if (bFull) {
if (item2.checked) {
item.title = sTip;
item2.style.visibility = "visible";
} else {
item.title = sFullTip;
item2.style.visibility = "hidden";
}
} else {
item.title = sTip;
item2.style.visibility = "visible";
}
});
elChk.className = "gptCartCheckBox";
if (dojo.isIE <= 8) {
if (bChecked) {
elChk = document.createElement(
"<input checked="\"checked\"/" type="\"checkbox\"">");
} else {
elChk.type = "checkbox";
}
} else {
elChk.type = "checkbox";
if (bChecked) elChk.checked = true;
}
connectCheck(elChk);
if (!bChecked && bFull) {
elChk.style.visibility = "hidden";
sTip = this.i18n["catalog.cart.isfull"];
sTip = sTip.replace("{0}",""+this.maxItems);
} else {
elChk.style.visibility = "visible";
}
var elSpan = document.createElement("span");
elSpan.className = "gptCartCheckControl";
elSpan.title = sTip;
dojo.style(elSpan,{
paddingTop: "5px",
paddingRight: "2px",
marginRight: "10px",
border: "1px solid #808080"
});
elSpan.appendChild(elChk);