Skip to content

Commit

Permalink
build: release 2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed Mar 1, 2018
1 parent 80824fc commit b853301
Show file tree
Hide file tree
Showing 9 changed files with 1,238 additions and 286 deletions.
42 changes: 23 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,93 @@
# Changelog

### 2.0.2 (Dec 1, 2017)
## 2.0.3 (Mar 1, 2018)

- Update districts.

## 2.0.2 (Dec 1, 2017)

- Trigger change event once district changed.
- Support to load in node environment.
- Update districts.

### 2.0.1 (Sep 1, 2017)
## 2.0.1 (Sep 1, 2017)

- Update districts.

### 2.0.0 (Jun 1, 2017)
## 2.0.0 (Jun 1, 2017)

- Update districts.
- Use `window.jQuery` instead of `window.$` for browser side usage.
- Change the `main` field value from `dist/distpicker.js` (UMD) to `dist/distpicker.common.js` (CommonJS).
- Added `module` and `browser` fields to `package.json`.

### 2.0.0-rc (Mar 4, 2017)
## 2.0.0-rc (Mar 4, 2017)

- Update districts.

### 2.0.0-beta.2 (Dec 8, 2016)
## 2.0.0-beta.2 (Dec 8, 2016)

- Build the source code with [Rollup](https://github.com/rollup/rollup).

### 2.0.0-beta.1 (Oct 15, 2016)
## 2.0.0-beta.1 (Oct 15, 2016)

- Fixed the issue of restoring saved districts by code (#19).

### 2.0.0-alpha.2 (Sep 6, 2016)
## 2.0.0-alpha.2 (Sep 6, 2016)

- Rename `autoSelect` option to `autoselect`.
- Subdivide optional values for `autoselect` option (#13).
- Fixed the wrong value of the `<select>` elements (#18).

### 2.0.0-alpha.1 (Aug 11, 2016)
## 2.0.0-alpha.1 (Aug 11, 2016)

- Merge the `distpicker.data.js` file to the `distpicker.js` file.
- Added a new option: `valueType`.
- Added a new method: `getDistricts`.

### 1.0.4 (Jun 1, 2016)
## 1.0.4 (Jun 1, 2016)

- Update districts data.

### 1.0.3 (Mar 3, 2016)
## 1.0.3 (Mar 3, 2016)

- Update districts data.

### 1.0.2 (Dec 26, 2015)
## 1.0.2 (Dec 26, 2015)

- Update lots of districts.

### 1.0.1 (Sep 6, 2015)
## 1.0.1 (Sep 6, 2015)

- Added new cities of Xizang (Tibet).

### 1.0.0 (Aug 27, 2015)
## 1.0.0 (Aug 27, 2015)

- Added new districts of Sanya city.
- Optimized code style.

### 0.2.1 (Dec 26, 2014)
## 0.2.1 (Dec 26, 2014)

- Enable to change the global default options.
- Fix placeholder bug.
- Improve code.

### 0.2.0 (Dec 20, 2014)
## 0.2.0 (Dec 20, 2014)

- Add new options: "autoSelect", "placeholder".
- Add new methods: "reset", "destroy".
- Use "data-distpicker" attribute for initializing automatically instead of "distpicker" attribute.

### 0.1.3 (Aug 9, 2014)
## 0.1.3 (Aug 9, 2014)

- Improve

### 0.1.2 (Apr 8, 2014)
## 0.1.2 (Apr 8, 2014)

- Fix a type error bug when initialize a city without districts.

### 0.1.1 (Feb 21, 2014)
## 0.1.1 (Feb 21, 2014)

- Fix bug: The default options will be changed when use multiple times in one page.

### 0.1.0 (Jan 25, 2014)
## 0.1.0 (Jan 25, 2014)
48 changes: 26 additions & 22 deletions dist/distpicker.common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*!
* Distpicker v2.0.2
* Distpicker v2.0.3
* https://github.com/fengyuanchen/distpicker
*
* Copyright (c) 2014-2017 Chen Fengyuan
* Copyright (c) 2014-2018 Chen Fengyuan
* Released under the MIT license
*
* Date: 2017-12-01T15:28:35.167Z
* Date: 2018-03-01T12:52:03.658Z
*/

'use strict';
Expand Down Expand Up @@ -1202,7 +1202,7 @@ var DISTRICTS = {
330122: '桐庐县',
330127: '淳安县',
330182: '建德市',
330185: '临安市'
330185: '临安区'
},
330200: {
330203: '海曙区',
Expand Down Expand Up @@ -1282,12 +1282,12 @@ var DISTRICTS = {
331002: '椒江区',
331003: '黄岩区',
331004: '路桥区',
331021: '玉环市',
331022: '三门县',
331023: '天台县',
331024: '仙居县',
331081: '温岭市',
331082: '临海市'
331082: '临海市',
331083: '玉环市'
},
331100: {
331102: '莲都区',
Expand Down Expand Up @@ -1479,7 +1479,7 @@ var DISTRICTS = {
350125: '永泰县',
350128: '平潭县',
350181: '福清市',
350182: '长乐市'
350182: '长乐区'
},
350200: {
350203: '思明区',
Expand Down Expand Up @@ -1609,7 +1609,7 @@ var DISTRICTS = {
360400: {
360402: '濂溪区',
360403: '浔阳区',
360421: '九江县',
360421: '柴桑区',
360423: '武宁县',
360424: '修水县',
360425: '永修县',
Expand Down Expand Up @@ -1693,7 +1693,7 @@ var DISTRICTS = {
361100: {
361102: '信州区',
361103: '广丰区',
361121: '上饶县',
361121: '广信区',
361123: '玉山县',
361124: '铅山县',
361125: '横峰县',
Expand Down Expand Up @@ -1743,7 +1743,7 @@ var DISTRICTS = {
370213: '李沧区',
370214: '城阳区',
370281: '胶州市',
370282: '即墨市',
370282: '即墨区',
370283: '平度市',
370285: '莱西市'
},
Expand Down Expand Up @@ -2981,7 +2981,7 @@ var DISTRICTS = {
510600: {
510603: '旌阳区',
510623: '中江县',
510626: '罗江县',
510626: '罗江区',
510681: '广汉市',
510682: '什邡市',
510683: '绵竹市'
Expand Down Expand Up @@ -3018,7 +3018,7 @@ var DISTRICTS = {
511011: '东兴区',
511024: '威远县',
511025: '资中县',
511028: '隆昌市'
511083: '隆昌市'
},
511100: {
511102: '市中区',
Expand Down Expand Up @@ -3184,7 +3184,7 @@ var DISTRICTS = {
520201: '钟山区',
520203: '六枝特区',
520221: '水城县',
520222: '盘州市'
520281: '盘州市'
},
520300: {
520302: '红花岗区',
Expand Down Expand Up @@ -3643,7 +3643,7 @@ var DISTRICTS = {
},
610700: {
610702: '汉台区',
610721: '南郑县',
610721: '南郑区',
610722: '城固县',
610723: '洋县',
610724: '西乡县',
Expand Down Expand Up @@ -4357,7 +4357,6 @@ var Distpicker = function () {
key: 'destroy',
value: function destroy() {
this.unbind();
this.$element.removeData(NAMESPACE);
}
}], [{
key: 'setDefaults',
Expand All @@ -4381,24 +4380,29 @@ if ($.fn) {

this.each(function (i, element) {
var $element = $(element);
var data = $element.data(NAMESPACE);
var isDestroy = option === 'destroy';
var distpicker = $element.data(NAMESPACE);

if (!data) {
if (/destroy/.test(option)) {
if (!distpicker) {
if (isDestroy) {
return;
}

var options = $.extend({}, $element.data(), $.isPlainObject(option) && option);

data = new Distpicker(element, options);
$element.data(NAMESPACE, data);
distpicker = new Distpicker(element, options);
$element.data(NAMESPACE, distpicker);
}

if (typeof option === 'string') {
var fn = data[option];
var fn = distpicker[option];

if ($.isFunction(fn)) {
result = fn.apply(data, args);
result = fn.apply(distpicker, args);

if (isDestroy) {
$element.removeData(NAMESPACE);
}
}
}
});
Expand Down
Loading

0 comments on commit b853301

Please sign in to comment.