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