Skip to content

Commit

Permalink
v7.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sutara79 committed Oct 30, 2017
1 parent e08b2b3 commit 3db510e
Show file tree
Hide file tree
Showing 5 changed files with 2,154 additions and 23 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# jquery.ajax-combobox

[![npm version](https://img.shields.io/npm/v/jquery.ajax-combobox.svg)](https://www.npmjs.com/package/jquery.ajax-combobox)
[![Build Status](https://travis-ci.org/sutara79/jquery.ajax-combobox.svg?branch=master)](https://travis-ci.org/sutara79/jquery.ajax-combobox)
[![codecov](https://codecov.io/gh/sutara79/jquery.ajax-combobox/branch/master/graph/badge.svg)](https://codecov.io/gh/sutara79/jquery.ajax-combobox)
[![dependencies Status](https://david-dm.org/sutara79/jquery.ajax-combobox/status.svg)](https://david-dm.org/sutara79/jquery.ajax-combobox)
Expand All @@ -15,10 +16,10 @@ http://www.usamimi.info/~sutara/ajax-combobox/
## Install
- [GitHub](https://github.com/sutara79/jquery.ajax-combobox): Clone or download. Only you need is `dist/`.
- [npm](https://www.npmjs.com/package/jquery.ajax-combobox): `npm i jquery.ajax-combobox`
- CDN ([jsDelivr](https://github.com/jsdelivr/jsdelivr#usage)):
- jquery.ajax-combobox.min.js: [v7.4.5](https://cdn.jsdelivr.net/npm/[email protected].5/dist/js/jquery.ajax-combobox.min.js)
- jquery.ajax-combobox.min.css: [v7.4.5](https://cdn.jsdelivr.net/npm/[email protected].5/dist/css/jquery.ajax-combobox.min.css)
- btn.png: [v7.4.5](https://cdn.jsdelivr.net/npm/[email protected].5/dist/btn.png)
- CDN ([jsDelivr](https://www.jsdelivr.com/)):
- [jquery.ajax-combobox.min.js (v7.4.6)](https://cdn.jsdelivr.net/npm/[email protected].6/dist/js/jquery.ajax-combobox.min.js)
- [jquery.ajax-combobox.min.css (v7.4.6)](https://cdn.jsdelivr.net/npm/[email protected].6/dist/css/jquery.ajax-combobox.min.css)
- [btn.png (v7.4.6)](https://cdn.jsdelivr.net/npm/[email protected].6/dist/btn.png)
- In addition to above, `dist/php/*.php` is REQUIRED.


Expand Down
25 changes: 11 additions & 14 deletions dist/js/jquery.ajax-combobox.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file jquery.ajax-combobox
* @version 7.4.5
* @version 7.4.6
* @author Yuusaku Miyazaki <[email protected]>
* @license MIT
*/
Expand Down Expand Up @@ -154,20 +154,17 @@ $.extend($.ajaxComboBox.prototype, /** @lends external:jQuery.ajaxComboBox.proto
*/
_setOption2nd: function(option) {
// 検索するフィールド(カンマ区切りで複数指定可能)
option.search_field = (option.search_field === undefined) ?
option.field :
option.search_field;
option.search_field = (option.search_field) ? option.search_field : option.field;

// 大文字で統一
// Unify with uppercase
option.and_or = option.and_or.toUpperCase();

// カンマ区切りのオプションを配列に変換する。
var arr = ['hide_field', 'show_field', 'search_field'];
for (var i=0; i<arr.length; i++) {
option[arr[i]] = this._strToArray(option[arr[i]]);
}
// Split string into array by comma
option.hide_field = this._strToArray(option.hide_field);
option.show_field = this._strToArray(option.show_field);
option.search_field = this._strToArray(option.search_field);

// Show rest fields as sub info
// Show whole rest fields as sub info, if "show_field" is not set.
if (option.show_field[0] === '') {
option.show_field[0] = '*'
}
Expand All @@ -194,10 +191,10 @@ $.extend($.ajaxComboBox.prototype, /** @lends external:jQuery.ajaxComboBox.proto
},

/**
* Split string into array by comma.
* @private
* @desc カンマ区切りの文字列を配列にする。
* @arg {string} str - 文字列
* @return {Array} - 配列
* @arg {string} str - Comma separated string
* @return {array} Array splitted by comma
*/
_strToArray: function(str) {
return str.replace(/[\s ]+/g, '').split(',');
Expand Down
4 changes: 2 additions & 2 deletions dist/js/jquery.ajax-combobox.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 3db510e

Please sign in to comment.