jquery-multi-typeahead-rails 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
|
-
* multi-typeahead.js v0.1
|
2
|
+
* multi-typeahead.js v0.1.1
|
3
3
|
*
|
4
|
-
* jQuery Multi Typeahead Plugin v0.1.
|
4
|
+
* jQuery Multi Typeahead Plugin v0.1.1
|
5
5
|
* https://github.com/kendrikat/jquery-multi-typeahead.js
|
6
6
|
*
|
7
7
|
* Copyright 2013 Klaas Endrikat
|
@@ -29,7 +29,8 @@
|
|
29
29
|
tokenizer: false,
|
30
30
|
local: "",
|
31
31
|
prefill: "",
|
32
|
-
fixed: false
|
32
|
+
fixed: false,
|
33
|
+
delimiter: [",", " "]
|
33
34
|
}
|
34
35
|
|
35
36
|
$.addTag = function (value) {
|
@@ -90,17 +91,22 @@
|
|
90
91
|
$.refresh();
|
91
92
|
});
|
92
93
|
|
93
|
-
typeaheadInput.
|
94
|
-
var
|
94
|
+
typeaheadInput.keypress(function (e) {
|
95
|
+
var consume = true;
|
96
|
+
var code = (e.charCode ? e.charCode : e.which);
|
95
97
|
if (code == 8 && typeaheadInput.val().length == 0) {
|
96
98
|
typeaheadContainer.find('span.tag').last().remove();
|
97
99
|
$.refresh();
|
98
100
|
}
|
99
|
-
if (!multiTypeaheadOptions.tokenizer) {
|
100
|
-
|
101
|
-
|
102
|
-
|
101
|
+
if (!multiTypeaheadOptions.tokenizer && typeaheadInput.val().length > 0 && !typeaheadContainer.find('.tt-dropdown-menu').is(':visible')) {
|
102
|
+
$.each(multiTypeaheadOptions.delimiter, function () {
|
103
|
+
if (code == this.charCodeAt(0) || code == 13) {
|
104
|
+
$.addTag(typeaheadInput.val().replace(this, '').trim());
|
105
|
+
consume = false;
|
106
|
+
}
|
107
|
+
});
|
103
108
|
}
|
109
|
+
return consume;
|
104
110
|
});
|
105
111
|
|
106
112
|
if (!multiTypeaheadOptions.tokenizer) {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-multi-typeahead-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-25 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Integrates the jquery-multi-typeahead plugin with the asset pipeline
|
15
15
|
email:
|