Created
June 6, 2014 14:42
-
-
Save AstakhovArtem/420f8b5fc5e5008602d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_disableEnableAll: function(element, isDisabled) { | |
var descendants = element.descendants(); | |
for (var k in descendants) { | |
if(k !== 'toJSON') { | |
descendants[k].disabled = isDisabled; | |
} | |
} | |
element.disabled = isDisabled; | |
}, | |
syncWithBilling: function () { | |
$('billing-address-select') && this.newAddress(!$('billing-address-select').value); | |
$('shipping:same_as_billing').checked = true; | |
if (!$('billing-address-select') || !$('billing-address-select').value) { | |
arrElements = Form.getElements(this.form); | |
for (var elemIndex in arrElements) { | |
if(elemIndex !== 'toJSON') { | |
if (arrElements[elemIndex].id) { | |
var sourceField = $(arrElements[elemIndex].id.replace(/^shipping:/, 'billing:')); | |
if (sourceField){ | |
arrElements[elemIndex].value = sourceField.value; | |
} | |
} | |
} | |
} | |
//$('shipping:country_id').value = $('billing:country_id').value; | |
shippingRegionUpdater.update(); | |
$('shipping:region_id').value = $('billing:region_id').value; | |
$('shipping:region').value = $('billing:region').value; | |
//shippingForm.elementChildLoad($('shipping:country_id'), this.setRegionValue.bind(this)); | |
} else { | |
$('shipping-address-select').value = $('billing-address-select').value; | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment