Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Jul 24, 2023
2 parents 56fa540 + f578a5c commit 7754300
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public static function getConfig()
}

/**
* Add observer to even object
* Add observer to events object
*
* @param string $eventName
* @param callback $callback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ if (!Mage::helper('usa')->validateUpsType($storedUpsType)) {

this.setFormValues();
Event.observe($(this.carriersUpsTypeId), 'change', this.setFormValues.bind(this));
Event.observe($('carriers_ups_active'), 'change', this.setFormValues.bind(this));
},
updateAllowedMethods: function(originShipmentTitle)
{
Expand Down Expand Up @@ -158,23 +159,15 @@ if (!Mage::helper('usa')->validateUpsType($storedUpsType)) {
setFormValues: function()
{
var a;
if ($F(this.carriersUpsTypeId) == 'UPS') {
for (a = 0; a < this.checkingUpsXmlId.length; a++) {
$(this.checkingUpsXmlId[a]).removeClassName('required-entry');
}
for (a = 0; a < this.checkingUpsId.length; a++) {
$(this.checkingUpsXmlId[a]).addClassName('required-entry');
}
Event.stopObserving($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this));
showRowArrayElements(this.onlyUpsElements);
hideRowArrayElements(this.onlyUpsXmlElements);
this.changeOriginShipment(null, 'default');
} else {
for (a = 0; a < this.checkingUpsXmlId.length; a++) {
$(this.checkingUpsXmlId[a]).addClassName('required-entry');
}
for (a = 0; a < this.checkingUpsId.length; a++) {
$(this.checkingUpsXmlId[a]).removeClassName('required-entry');
if ($F(this.carriersUpsTypeId) == 'UPS_XML') {
if (document.getElementById('carriers_ups_active').value == 1) {
for (a = 0; a < this.checkingUpsXmlId.length; a++) {
$(this.checkingUpsXmlId[a]).addClassName('required-entry');
}
} else {
for (a = 0; a < this.checkingUpsXmlId.length; a++) {
$(this.checkingUpsXmlId[a]).removeClassName('required-entry');
}
}
Event.observe($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this));
showRowArrayElements(this.onlyUpsXmlElements);
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7754300

Please sign in to comment.