From c17336d1ac26a12083cfcbefdf213f25ec8c1dde Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Mon, 16 Jul 2012 11:35:04 +0300 Subject: [PATCH] rename tagSeparator to separator. #191 --- select2.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/select2.js b/select2.js index 43b3f2ec..95a9ee98 100755 --- a/select2.js +++ b/select2.js @@ -535,8 +535,8 @@ } //Custom tags separator. - opts.tagSeparator = opts.tagSeparator || ","; - + opts.separator = opts.separator || ","; + if (select) { // these options are not allowed when attached to a select because they are picked up off the element itself $.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () { @@ -666,7 +666,7 @@ opts.createSearchChoice = function (term) { return {id: term, text: term}; }; opts.initSelection = function (element, callback) { var data = []; - $(splitVal(element.val(), opts.tagSeparator)).each(function () { + $(splitVal(element.val(), opts.separator)).each(function () { data.push({id: this, text: this}); }); @@ -1470,7 +1470,7 @@ opts = $.extend({}, { closeOnSelect: true }, opts); - + // TODO validate placeholder is a string if specified if (opts.element.get(0).tagName.toLowerCase() === "select") { @@ -1830,7 +1830,7 @@ return val === null ? [] : val; } else { val = this.opts.element.val(); - return splitVal(val, this.opts.tagSeparator); + return splitVal(val, this.opts.separator); } },