Compare commits
No commits in common. "master" and "0.1.3" have entirely different histories.
@ -12,8 +12,6 @@
|
||||
var _countryClass = "crs-country";
|
||||
var _defaultCountryStr = "Select country";
|
||||
var _defaultRegionStr = "Select region";
|
||||
var _defaultCountryValue = null;
|
||||
var _defaultRegionValue = null;
|
||||
|
||||
// originally an object, but converted to an array to reduce size
|
||||
var _data = [
|
||||
@ -276,12 +274,11 @@
|
||||
|
||||
var _populateCountryFields = function() {
|
||||
var countryElement = this;
|
||||
_defaultCountryValue = $(countryElement).val();
|
||||
countryElement.length = 0;
|
||||
var customOptionStr = $(countryElement).attr("data-default-option");
|
||||
var defaultOptionStr = customOptionStr ? customOptionStr : _defaultCountryStr;
|
||||
|
||||
var defaultSelectedValue = _defaultCountryValue ? _defaultCountryValue : $(countryElement).attr("data-default-value");
|
||||
var defaultSelectedValue = $(countryElement).attr("data-default-value");
|
||||
var customValue = $(countryElement).attr("data-value");
|
||||
var foundIndex = 0;
|
||||
|
||||
@ -310,7 +307,7 @@
|
||||
if (defaultSelectedValue) {
|
||||
_populateRegionFields(countryElement, regionElement);
|
||||
|
||||
var defaultRegionSelectedValue = _defaultRegionValue ? _defaultRegionValue : $(regionElement).attr("data-default-value");
|
||||
var defaultRegionSelectedValue = $(regionElement).attr("data-default-value");
|
||||
if (defaultRegionSelectedValue !== null) {
|
||||
var data = _data[countryElement.selectedIndex-1][2].split("|");
|
||||
_setDefaultRegionValue(regionElement, data, defaultRegionSelectedValue);
|
||||
@ -323,7 +320,6 @@
|
||||
};
|
||||
|
||||
var _initRegionField = function(el) {
|
||||
_defaultRegionValue = $(el).val();
|
||||
var customOptionStr = $(el).attr("data-blank-option");
|
||||
var defaultOptionStr = customOptionStr ? customOptionStr : "-";
|
||||
el.length = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user