Lines Matching defs:choice

593      * opts.tokenSeparators array and uses opts.createSearchChoice to create the choice object. Both of those
598 * @param selectCallback function(choice) callback tho add the choice to selection
604 dupe = false, // check for whether a token we extracted represents a duplicate selected choice
1486 var choice = $(choices[index]);
1487 if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled") && !choice.hasClass("select2-selected")) {
1497 choice,
1509 choice = $(choices[index]);
1510 choice.addClass("select2-highlighted");
1512 // ensure assistive technology can determine the active choice
1513 this.search.attr("aria-activedescendant", choice.find(".select2-result-label").attr("id"));
1517 this.liveRegion.text(choice.text());
1519 data = choice.data("select2-data");
1521 this.opts.element.trigger({ type: "select2-highlight", val: this.id(data), choice: data });
1700 var def; // default choice
1715 // create a default choice and prepend it to the list
1765 this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
1877 "<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>",
1878 " <span class='select2-chosen'>&nbsp;</span><abbr class='select2-search-choice-close'></abbr>",
2006 this.selection = selection = container.find(".select2-choice");
2191 this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
2349 this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data });
2552 selectChoice: function (choice) {
2554 var selected = this.container.find(".select2-search-choice-focus");
2555 if (selected.length && choice && choice[0] == selected[0]) {
2559 this.opts.element.trigger("choice-deselected", selected);
2561 selected.removeClass("select2-search-choice-focus");
2562 if (choice && choice.length) {
2564 choice.addClass("select2-search-choice-focus");
2565 this.opts.element.trigger("choice-selected", choice);
2586 this.selection.on("click", ".select2-search-choice:not(.select2-locked)", function (e) {
2613 var selected = selection.find(".select2-search-choice-focus");
2614 var prev = selected.prev(".select2-search-choice:not(.select2-locked)");
2615 var next = selected.next(".select2-search-choice:not(.select2-locked)");
2650 this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last());
2723 if ($(e.target).closest(".select2-search-choice").length > 0) {
2724 // clicked inside a select2 search choice, do not open
2858 this.selection.find(".select2-search-choice").remove();
2885 this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data });
2939 "<li class='select2-search-choice'>" +
2941 " <a href='#' class='select2-search-choice-close' tabindex='-1'></a>" +
2944 "<li class='select2-search-choice select2-locked'>" +
2947 var choice = enableChoice ? enabledItem : disabledItem,
2953 formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
2955 choice.find("div").replaceWith("<div>"+formatted+"</div>");
2957 cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
2959 choice.addClass(cssClass);
2963 choice.find(".select2-search-choice-close")
2969 this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
2980 choice.data("select2-data", data);
2981 choice.insertBefore(this.searchContainer);
2992 selected = selected.closest(".select2-search-choice");
2995 throw "Invalid argument: " + selected + ". Must be .select2-search-choice";
3008 evt.choice = data;
3023 this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
3036 choices.each2(function (i, choice) {
3037 var id = self.id(choice.data("select2-data"));
3039 choice.addClass("select2-selected");
3041 choice.find(".select2-result-selectable").addClass("select2-selected");
3045 compound.each2(function(i, choice) {
3047 if (!choice.is('.select2-result-selectable')
3048 && choice.find(".select2-result-selectable:not(.select2-selected)").length === 0) {
3049 choice.addClass("select2-selected");
3225 this.selection.find(".select2-search-choice").each(function() {
3237 .children(".select2-search-choice")