-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read only configuration #135
Comments
@fvisticot we don't have this currently, but it would not be hard to add by adding a new API parameter "readonly" and preventing the delete action. As for hiding the 'x' characters, you could do this either in the HTML generation, setting the tagCloseIcon to an empty string (''), or via CSS. |
I have done this - I do not have time to do a full pull request, but here is the codez (im sure it can be improved): option:
Function to determine if read only. Note that I did this while using a specific framework which gives me values of 'True' based on my ACL rules. var isReadOnly = function() {
return (tagManagerOptions.readOnly == 'True' ||
tagManagerOptions.readOnly == true ||
tagManagerOptions.readOnly == 'true' ||
tagManagerOptions.readOnly == 1);
}; Check to make the input box disabled if readOnly:
Note: I realize in version 3.0 deleteTagsOnBackspace is deprecated, this is for version 2.4.2 Code to handle the remove button: if (!isReadOnly()) {
html += '<a href="#" class="tm-tag-remove" id="' + newTagRemoveId + '" TagIdToRemove="' + tagId + '">';
html += tagManagerOptions.tagCloseIcon + '</a> ';
} |
@jjwilliams can you please make this into a pull request so we can review, or if no time, make a gist of the file? |
Sure, I will work on it this weekend. One issue I had when trying was getting a working example going. Is it just me or is docs.html lacking? Its missing jquery, bootstrap, and typeahead references. |
@jjwilliams The way docs.html runs it's embedded into another page. It's synced automatically here and updates every 5 mins from Github: |
Submitted a pull request for this, #167 |
I need to display all the tags in a "read only" mode (without the cross) and without the input box to add new tag.
Is it possible ? how ?
The text was updated successfully, but these errors were encountered: