1
0
mirror of synced 2024-11-25 22:36:03 +03:00

Merge pull request #2286 from interestincode/patch-1

Update select2.js, fixes #781
This commit is contained in:
Kevin Brown 2014-04-15 11:26:44 -04:00
commit 00716adf65

View File

@ -114,16 +114,12 @@ the specific language governing permissions and limitations under the Apache Lic
} }
function stripDiacritics(str) { function stripDiacritics(str) {
var ret, i, l, c; // Used 'uni range + named function' from http://jsperf.com/diacritics/18
function match(a) {
if (!str || str.length < 1) return str; return DIACRITICS[a] || a;
ret = "";
for (i = 0, l = str.length; i < l; i++) {
c = str.charAt(i);
ret += DIACRITICS[c] || c;
} }
return ret;
return str.replace(/[^\u0000-\u007E]/g, match);
} }
function indexOf(value, array) { function indexOf(value, array) {