From 4560064631ff37d891643c8b664e47732d4fd38a Mon Sep 17 00:00:00 2001 From: lars Date: Thu, 10 Oct 2013 18:15:13 +0200 Subject: [PATCH] Added option to preserve tab-key action in case there is tag limit set and reached. --- tagmanager.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tagmanager.js b/tagmanager.js index 395de57..07072bf 100644 --- a/tagmanager.js +++ b/tagmanager.js @@ -48,7 +48,8 @@ tagCloseIcon: 'x', tagClass: '', validator: null, - onlyTagList: false + onlyTagList: false, + preserveTabFocus: false }; // exit when no matched elements @@ -363,7 +364,9 @@ var applyDelimiter = function (e) { pushTag(obj.val()); - e.preventDefault(); + if(e.keyCode === 9 && tagManagerOptions.preserveTabFocus !== true){ + e.preventDefault(); + } }; var returnValue = null; @@ -397,7 +400,7 @@ obj.data("tlis", tlis); //list of string tags obj.data("tlid", tlid); //list of ID of the string tags - if (tagManagerOptions.output == null) { + if (tagManagerOptions.output == null) { var hiddenObj = jQuery('', { type: 'hidden', name: tagManagerOptions.hiddenTagListName