From 47c18916a8807d412cbd4fdeb8a25f8be9e679ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Marc=20Lagac=C3=A9?= Date: Tue, 19 May 2015 09:08:50 -0400 Subject: [PATCH] Fix for issue #779 ( loopj/jquery-tokeninput ) Fields should only be initialized once. --- src/jquery.tokeninput.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/jquery.tokeninput.js b/src/jquery.tokeninput.js index 4b69d823..9c8967bb 100755 --- a/src/jquery.tokeninput.js +++ b/src/jquery.tokeninput.js @@ -198,6 +198,12 @@ // // Initialization // + + // an input field is only initialized once + if( $(input).data("tokenInputInitialized") ) { + return true; + } + $(input).data("tokenInputInitialized", true); // Configure the data source if (typeof(url_or_data) === "string" || typeof(url_or_data) === "function") {