Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
aehlke committed Nov 23, 2012
1 parent 5581e71 commit 98d0536
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 7 additions & 3 deletions js/tag-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@
return this.tagList.children('.tagit-choice:last');
},

_tags: function() {
return this.tagList.children('.tagit-choice');
},

assignedTags: function() {
// Returns an array of tag string values
var that = this;
Expand All @@ -260,7 +264,7 @@
tags = [];
}
} else {
this.tagList.children('.tagit-choice').each(function() {
this._tags().each(function() {
tags.push(that.tagLabel(this));
});
}
Expand Down Expand Up @@ -294,7 +298,7 @@
_isNew: function(value) {
var that = this;
var isNew = true;
this.tagList.children('.tagit-choice').each(function(i) {
this._tags().each(function(i) {
if (that._formatStr(value) == that._formatStr(that.tagLabel(this))) {
isNew = false;
return false;
Expand Down Expand Up @@ -390,7 +394,7 @@
removeAll: function() {
// Removes all tags.
var that = this;
this.tagList.children('.tagit-choice').each(function(index, tag) {
this._tags().each(function(index, tag) {
that.removeTag(tag, false);
});
}
Expand Down
10 changes: 5 additions & 5 deletions js/tag-it.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 98d0536

Please sign in to comment.