Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

honor disabled inputs #341

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ option to false.
'removeWithBackspace' : true,
'minChars' : 0,
'maxChars' : 0, // if not provided there is no limit
'placeholderColor' : '#666666'
'placeholderColor' : '#666666',
'honorDisabled' : false
});
2 changes: 1 addition & 1 deletion dist/jquery.tagsinput.min.css

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

2 changes: 1 addition & 1 deletion dist/jquery.tagsinput.min.js

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

16 changes: 12 additions & 4 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

$(function() {


$('#tags_1').tagsInput({width:'auto'});
$('#tags_2').tagsInput({
width: 'auto',
Expand All @@ -45,13 +46,17 @@
//autocomplete_url:'test/fake_plaintext_endpoint.html' //jquery.autocomplete (not jquery ui)
autocomplete_url:'test/fake_json_endpoint.html' // jquery ui autocomplete requires a json endpoint
});
$('#tags_4').tagsInput({
width:'auto',
honorDisabled: true
});


// Uncomment this line to see the callback functions in action
// $('input.tags').tagsInput({onAddTag:onAddTag,onRemoveTag:onRemoveTag,onChange: onChangeTag});
// Uncomment this line to see the callback functions in action
// $('input.tags').tagsInput({onAddTag:onAddTag,onRemoveTag:onRemoveTag,onChange: onChangeTag});

// Uncomment this line to see an input with no interface for adding new tags.
// $('input.tags').tagsInput({interactive:false});
// Uncomment this line to see an input with no interface for adding new tags.
// $('input.tags').tagsInput({interactive:false});
});

</script>
Expand All @@ -65,4 +70,7 @@
<p><label>Autocomplete:</label>
<input id='tags_3' type='text' class='tags'></p>

<p><label>Disabled Input:</label>
<input id="tags_4" type='text' class='tags' value="foo,bar,baz,roffle" disabled/></p>

</form>
1 change: 1 addition & 0 deletions src/jquery.tagsinput.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
div.tagsinput { border:1px solid #CCC; background: #FFF; padding:5px; width:300px; height:100px; overflow-y: auto;}
div.tagsinput.inputdisabled span.tag a { cursor:default;}
div.tagsinput span.tag { border: 1px solid #a5d24a; -moz-border-radius:2px; -webkit-border-radius:2px; display: block; float: left; padding: 5px; text-decoration:none; background: #cde69c; color: #638421; margin-right: 5px; margin-bottom:5px;font-family: helvetica; font-size:13px;}
div.tagsinput span.tag a { font-weight: bold; color: #82ad2b; text-decoration:none; font-size: 11px; }
div.tagsinput input { width:80px; margin:0px; font-family: helvetica; font-size: 13px; border:1px solid transparent; padding:5px; background: transparent; color: #000; outline:0px; margin-right:5px; margin-bottom:5px; }
Expand Down
Loading