From 0160b36a38fa6482e5389e37b1bd367d00cc45aa Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Thu, 3 May 2012 15:05:39 -0700 Subject: [PATCH] missed one place where id is accessed. issue #51 --- select2.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 select2.js diff --git a/select2.js b/select2.js old mode 100644 new mode 100755 index 29d184e9..9ece8c36 --- a/select2.js +++ b/select2.js @@ -1,4 +1,4 @@ -/* +/* Copyright 2012 Igor Vaynberg Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in @@ -484,6 +484,7 @@ }); query.callback(data); }); + // this is needed because inside val() we construct choices from options and there id is hardcoded opts.id=function(e) { return e.id; }; } else { if (!("query" in opts)) { @@ -1303,7 +1304,7 @@ throw "Invalid argument: " + selected + ". Must be .select2-search-choice"; } - index = indexOf(selected.data("select2-data").id, val); + index = indexOf(this.id(selected.data("select2-data")), val); if (index >= 0) { val.splice(index, 1);