Skip to content

Commit 972800a

Browse files
committed
xoxco#186 - Avoid re-initializing tag fields that are already initialized
1 parent d5f153b commit 972800a

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery.tagsinput",
3-
"version": "1.3.4",
3+
"version": "1.3.5",
44
"main": ["src/jquery.tagsinput.js", "src/jquery.tagsinput.css"],
55
"ignore": [
66
"**/.*",

dist/jquery.tagsinput.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jQuery-Tags-Input",
3-
"version": "1.3.4",
3+
"version": "1.3.5",
44
"description": "",
55
"main": "jquery.tagsinput.js",
66
"directories": {

src/jquery.tagsinput.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@
195195
var uniqueIdCounter = 0;
196196

197197
this.each(function() {
198+
// If we have already initialized the field, do not do it again
199+
if (typeof $(this).attr('data-tagsinput-init') !== 'undefined') {
200+
return;
201+
}
202+
203+
// Mark the field as having been initialized
204+
$(this).attr('data-tagsinput-init', true);
205+
198206
if (settings.hide) {
199207
$(this).hide();
200208
}

0 commit comments

Comments
 (0)