Update jQuery version

Fix small problem with tagExist
This commit is contained in:
Ben Brown
2012-04-11 15:48:14 -05:00
parent 6d8d9d9a4f
commit 0403f22e12
2 changed files with 7 additions and 8 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
<link rel="stylesheet" type="text/css" href="http://xoxco.com/projects/code/tagsinput/jquery.tagsinput.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.tagsinput.js"></script>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js'></script>
@@ -79,6 +79,6 @@
<input id="tags_2" type="text" class="tags" value="php,ios,javascript,ruby,android,kindle" /></p>
<p><label>Autocomplete:</label>
<input id='tags_3' type='text' class='tags'></p>
<input id='tags_3' type='text' class='tags' /></p>
</form>
+5 -6
View File
@@ -96,7 +96,7 @@
var skipTag = false;
if (options.unique) {
skipTag = $(tagslist).tagExist(value);
skipTag = $(this).tagExist(value);
if(skipTag == true) {
//Marks fake input as not_valid to let styling it
$(settings.fake_input).addClass('not_valid');
@@ -185,11 +185,10 @@
return false;
};
$.fn.tagExist = function(val) {
var settings = $(this).data('settings');
var tagslist = $(this).val().split(settings.delimiter);
return (jQuery.inArray(val, tagslist) >= 0); //true when tag exists, false when not
$.fn.tagExist = function(val) {
var settings = $(this).data('settings');
var tagslist = $(this).val().split(settings.delimiter);
return (jQuery.inArray(val, tagslist) >= 0); //true when tag exists, false when not
};
// clear all existing tags and import new ones from a string