Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

removeTagByName singleField option support #120

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+9 −3
Split
View
@@ -493,7 +493,13 @@
},
removeTagByName: function(tagName, animate) {
- var toRemove = this._tags().find("input[value='" + tagName + "']").closest('.tagit-choice');
+ var toRemove = [];
+ if (this.options.singleField) {
+ existingTags = $(this.options.singleFieldNode).val().split(",");
+ toRemove = this._tags().find("span.tagit-label:contains('" + tagName + "')").closest('.tagit-choice');
+ } else {
+ toRemove = this._tags().find("input[value='" + tagName + "']").closest('.tagit-choice');
+ }
if (toRemove.length === 0) {
throw "No such tag exists with the name '" + tagName + "'";
}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.