Lines Matching refs:is

6 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
17 Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
159 // Check whether 'a' or 'b' is a string (primitive or object).
161 if (a.constructor === String) return a+'' === b+''; // a+'' - in case 'a' is a String object
162 if (b.constructor === String) return b+'' === a+''; // b+'' - in case 'b' is a String object
167 * Splits the string into an array of values, trimming each value. An empty array is returned for nulls or empty
206 * filters mouse events so an event is fired only if the mouse moved.
208 * filters out mouse events that occur when mouse is stationary but
265 /* set the focus in a 0 timeout - that way the focus is set after the processing
278 /* after the focus is set move the caret to the end, necessary when we val()
413 * The expected format is an object containing the following keys:
474 * If the array form is used it is assumed that it contains objects with 'id' and 'text' keys.
476 * If the object form is used ti is assumed that it contains 'data' and 'text' keys. The 'data' key should contain
478 * key can either be a String in which case it is expected that each element in the 'data' array has a key with the
486 text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
501 // if text is not a function we assume it to be a key name
503 dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available
559 * Throws an error if it is not a function. Returns true if it should be used,
750 // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel
776 // trap all mouse events from leaving the dropdown. sometimes there may be a modal that is listening
777 // for mouse events outside of itself so it can close itself. since the dropdown is now outside the select2's
778 // dom it will trigger the popup close, which is not what we want
779 // focusin can cause focus wars between modals and select2 since the dropdown is outside the modal.
843 if (element.is("option")) {
852 } else if (element.is("optgroup")) {
876 throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a <select> element.");
960 if (element.is("option")) {
964 } else if (element.is("optgroup")) {
975 // ignore the placeholder option if there is one
987 // this is needed because inside val() we construct choices from options and there id is hardcoded
1195 // always prefer the current above/below alignment, unless there is not enough room
1210 //if we are changing direction we need to get positions when dropdown is hidden;
1230 // Add scrollbar width to dropdown if vertical scrollbar is present
1242 // fix positioning when body has an offset and is not position: static
1299 * the dropdown is already open, or if the 'open' event listener on the element called preventDefault().
1354 // ensure the mask is always right before the dropdown
1440 // if the first element is highlighted scroll all the way to the top,
1454 // if this is the last child lets also make sure select2-more-results is visible
1468 // make sure the top of the element is visible
1470 results.scrollTop(results.scrollTop() + y); // y is negative
1545 if (el.length > 0 && !el.is(".select2-highlighted")) {
1558 below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
1606 * @param initial whether or not this is the call to this method right after the dropdown has been opened
1626 // if the search is currently hidden we do not alter the results
1762 // synonymous to .is(':focus'), which is available in jquery >= 1.6
1817 * Get the desired width for the container element. This is
1832 // check if there is inline style on the element that contains width
1845 // next check if css('width') can resolve a width that is percent based, this is sometimes possible
1932 // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2068 // a workaround for chrome to keep the search field focussed when the scroll bar is used to scroll the dropdown.
2069 // without this the search field loses focus which is annoying
2242 // install default initSelection when applied to hidden input and data is local
2267 // if a placeholder is specified on a single select without a valid placeholder option ignore it
2316 // hide the search box if this is the first we got the results and there are enough of them for search
2334 //add "select2-with-searchbox" to the container if search box is shown
2420 // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
2426 throw new Error("cannot call val() if initSelection() is not defined");
2498 // TODO validate placeholder is a string if specified
2512 // install default initSelection when applied to hidden input and data is local
2790 // stretch the search box to full width of the container so as much of the placeholder is visible as possible
2807 this.clearPlaceholder(); // should be done before super so placeholder is not used to search
2815 // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2923 // added we do not need to check if this is a new element before firing change
3001 // prevent a race condition when the 'x' is clicked really fast repeatedly the event can be queued
3047 if (!choice.is('.select2-result-selectable')
3163 // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
3174 // val is a list of ids
3184 throw new Error("val() cannot be called if initSelection() is not defined");
3203 throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");
3219 // make sure the search container is the last item in the list
3361 // Never focus the input if search is disabled