Skip to content

Commit

Permalink
update v1.3.9
Browse files Browse the repository at this point in the history
优化对 Zepto 的兼容(v1.3.8 需要 zepto data 模块支持)
  • Loading branch information
ciaoca committed Jan 12, 2016
1 parent 715df9f commit c0c353c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ cxSelect 是基于 jQuery 的多级联动菜单插件,适用于省市、商品

**版本:**

* jQuery v1.7+
* jQuery cxSelect v1.3.8
* jQuery v1.7+ | Zepto v1.0+
* jQuery cxSelect v1.3.9

文档:http://code.ciaoca.com/jquery/cxselect/

Expand Down Expand Up @@ -95,7 +95,7 @@ $.cxSelect.defaults.nodata = 'none';
<tr>
<td>required</td>
<td>false</td>
<td>是否为必选。设为 flase 时,会在列表头部添加 `&lt;option value="firstValue"&gt;firstTitle&lt;/option&gt;` 选项。</td>
<td>是否为必选。设为 false 时,会在列表头部添加 `&lt;option value="firstValue"&gt;firstTitle&lt;/option&gt;` 选项。</td>
</tr>
<tr>
<td>firstTitle</td>
Expand Down
12 changes: 6 additions & 6 deletions js/jquery.cxselect.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* jQuery cxSelect
* @name jquery.cxselect.js
* @version 1.3.8
* @date 2015-12-7
* @version 1.3.9
* @date 2016-01-06
* @author ciaoca
* @email [email protected]
* @site https://github.com/ciaoca/cxSelect
Expand Down Expand Up @@ -83,8 +83,8 @@
if (!_tempSelect) {break};

// 保存默认值
if (typeof _tempSelect.val() === 'string') {
_tempSelect.data('value', _tempSelect.val());
if (typeof _tempSelect.val() === 'string' && _tempSelect.val().length) {
_tempSelect.attr('data-value', _tempSelect.val());
};

self.selectArray.push(_tempSelect);
Expand All @@ -102,7 +102,7 @@
self.start();

// 设置 URL,通过 Ajax 获取数据
} else if (typeof self.settings.url === 'string') {
} else if (typeof self.settings.url === 'string' && self.settings.url.length) {
$.getJSON(self.settings.url, function(json) {
self.start(json);
});
Expand Down Expand Up @@ -284,7 +284,7 @@

// 初次加载设置默认值
if (typeof select.data('value') !== 'undefined') {
select.val(String(select.data('value'))).removeData('value').removeAttr('data-value');
select.val(String(select.data('value'))).removeAttr('data-value');
};

select.trigger('change');
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.cxselect.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0c353c

Please sign in to comment.