1
0
mirror of synced 2024-11-22 21:16:10 +03:00
This commit is contained in:
Igor Vaynberg 2013-07-03 23:08:55 -07:00
parent 81b98e7567
commit b8c203ca36

View File

@ -3041,7 +3041,8 @@ the specific language governing permissions and limitations under the Apache Lic
select2,
method, value, multiple,
allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "readonly", "positionDropdown", "data", "search"],
valueMethods = ["val", "opened", "isFocused", "container", "data"],
valueMethods = ["opened", "isFocused", "container", "dropdown"],
propertyMethods = ["val", "data"],
methodsMap = { search: "externalSearch" };
this.each(function () {
@ -3079,8 +3080,9 @@ the specific language governing permissions and limitations under the Apache Lic
value = select2[method].apply(select2, args.slice(1));
}
if (indexOf(args[0], valueMethods) >= 0) {
return false;
if (indexOf(args[0], valueMethods) >= 0
|| (indexOf(args[0], propertyMethods) && args.length == 1)) {
return false; // abort the iteration, ready to return first matched value
}
} else {
throw "Invalid arguments to select2 plugin: " + args;