From 11d9c9b115db9d5709ed2fa41d873aec1e9152a7 Mon Sep 17 00:00:00 2001 From: Harold Poskanzer Date: Thu, 17 Apr 2014 16:52:20 -0700 Subject: [PATCH] Add read-only option --- tagmanager.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tagmanager.js b/tagmanager.js index e280f4b..1e3a61a 100644 --- a/tagmanager.js +++ b/tagmanager.js @@ -42,6 +42,7 @@ onlyTagList: false, tagList: null, fillInputOnTagRemove: false, + readOnly : false, }, publicMethods = { @@ -138,8 +139,10 @@ html = ''; html+= '' + escaped + ''; - html+= ''; - html+= opts.tagCloseIcon + ' '; + if (!opts.readOnly) { + html+= ''; + html+= opts.tagCloseIcon + ' '; + } $el = $(html); if (opts.tagsContainer !== null) { @@ -471,6 +474,10 @@ privateMethods.prefill.call($self,$(opts.output).val().split(opts.baseDelimiter)); } + if (opts.readOnly) { + $self.hide(); + } + }); return this;