Skip to content

Commit

Permalink
SUG-392 : Disable duplicate fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Sp0i3eR committed Dec 23, 2014
1 parent a014eaf commit 9d0a950
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions upload/catalog/view/theme/default/template/module/dadata.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,24 @@
view_gender: "<?php echo $dadata_gender; ?>"
});
var addressParent = $('input[name*=address_1]').parents("tbody");
if (addressParent.length > 0) addressParent.prepend('<tr><td colspan = "2">' + addressInputHtml + '</td></tr >')
else {
addressParent = $('input[name*=address_1]').prevAll("span");
if (addressParent.length > 0)
addressParent.before(addressInputHtml);
}
if ($('input[name=address]').length == 0) {
var addressParent = $('input[name*=address_1]').parents("tbody");
if (addressParent.length > 0) addressParent.prepend('<tr><td colspan = "2">' + addressInputHtml + '</td></tr >')
else {
addressParent = $('input[name*=address_1]').prevAll("span");
if (addressParent.length > 0)
addressParent.before(addressInputHtml);
}
FullAddressSuggestions.init({
address: $('input[name=address]'),
url: dadataUrl,
token: "<?php echo $dadata_api; ?>",
tips: "<?php echo $dadata_tips;?>",
correction: "<?php echo $dadata_correction; ?>",
additional: "<?php echo $dadata_additional; ?>"
});
FullAddressSuggestions.init({
address: $('input[name=address]'),
url: dadataUrl,
token: "<?php echo $dadata_api; ?>",
tips: "<?php echo $dadata_tips;?>",
correction: "<?php echo $dadata_correction; ?>",
additional: "<?php echo $dadata_additional; ?>"
});
}
}
}
Expand Down

0 comments on commit 9d0a950

Please sign in to comment.