* "Loading array data" and "Loading remote data" now go together under "Other data sources",
* "Events" and "Programmatic access" under "Programmatic control",
* "Theme support", "Responsive design" and "Templating" under "Themes, templating and responsive design"
This also gets rid of the colored buttons in favor of `.btn-default`, prevents wrapping of the "Destroy" button of the first button group of the "Programmatic access" demos to a second line and consistently places buttons below the Select2 widgets they apply to.
Ref. http://getbootstrap.com/components/#btn-groups.
Adds
* version information
* links to the GitHub repository, issues and releases
* links to the examples and options
* a link to the 3.5.2 docs
to the footer as well as namespaced styles for the footer in general as well as all the above.
* adds styles for anchor.js (similar to the official Bootstrap docs)
* currently results some of the generated links to have a suffix (e. g. examples.html#templating-1) added due to sections having the same ID as the headline copy that we want to link to
This also fixes an issue where we were using the `full_name` for
the value instead of the `id` in the example, which technically
wasn't correct.
This closes https://github.com/select2/select2/issues/3148.
In the past, `initSelection` was used for loading in data objects
for the pre-selected options. Now that Select2 is using a `<select>`
element, there is no need for doing this because the `<option>`
elements should provide the relevant information. So you can now
just pull this information from the remote data source
(or static array, in some cases) and build out the `<option>`
elements manually.
In most cases you don't need to go the full length with a custom
data adapter, but instead are just looking to pre-load elements on
the initial page load.
This improves https://github.com/select2/select2/issues/3116.
This also fixes a possible issue where the `< 0` fallback would
not be used because the `minimumResultsForSearch` check would
always return false and never load in the module.
This closes https://github.com/select2/select2/pull/3077.
This adds basic documentation explaining that there are compatibility
decorators for `<input type="text" />` support. This is not fully
compatible with all features and requires the use of an external
adapter like the `ArrayAdapter` or `AjaxAdapter` to provide a
reasonable way to query results.
This also triggers a warning if the adapter is used with a hidden
input, as the degraded functionality when there is no JavaScript
support should be discouraged.
The documentation README was previously intended to be read from
the documentation repository, not from the source repository.
This had the potential to give off the impression that documentation
pull requests were not allowed, when exactly the opposite is the
case. The README has been improved to make it more clear how to
contribute pull requests to update the documentation.
Thanks to Brent Connor [1] for pointing out this issue over at
Stack Overflow [2].
[1]: https://stackoverflow.com/users/3954106/brent-connor
[2]: http://stackoverflow.com/q/28705192/359284
This adds documentation for the `templateResult` and
`templateSelection` options. The fact that placeholders and
custom messages are templated was noted, although most people
should be using the standard `text` property that they provide
anyway. This fixes the templating link provided in the release
announcement to link to the correct location in the documentation.
This also adds support for the `templateSelection` function to
return a DocumentFragment or jQuery compatible object to be
passed back and rendered.
This closes https://github.com/select2/select2/issues/3005.
This closes https://github.com/select2/select2/issues/3019.
The `closeOnSelect` option was previously used to control whether
or not the dropdown was closed when an option was selected. This
could be simulated by triggering the `open` event after the `close`
event was received, but it makes sense to abstract it out into a
decorator.
This also adds support for not closing the dropdown when the control
key is being held. This is useful when multiple options need to be
selected in quick succession, so the dropdown does not have to be
reopened.
This also adds documentation that covers both changes.
This closes https://github.com/select2/select2/pull/2735.
This closes https://github.com/select2/select2/issues/3017.
This also fixes the case where `templateResult` does not return a
string, where it will fall back to jQuery to set the value of the
option. This allows for the `templateResult` function to return a
jQuery or DOM element that contains the templated data.
Just like with the translation methods, only strings returned from
`templateResult` will be escaped.
The old flag icons have been transferred from the old repository to
the documentation, for use in the templates. Unfortunately I cannot
find a license for them, but I suspect a license isn't actually
needed considering the state flags are public.
This closes https://github.com/select2/select2/issues/3005.
This closes https://github.com/select2/select2/issues/818.
This splits out the two templating functions that are referenced in
the documentation. The two functions were previously available in
the source code, but they were not named with the method names that
the documentation referred to.
This closes https://github.com/select2/select2/issues/2993.
It appears as though GitHub has stopped serving the Placeholder.js
GitHub Pages site. This broke placeholder support on older versions
of IE in the documentation and broke the link we had to the
polyfill. Since the repository is still online, and the
documentation should work without an internet connection, the
JavaScript files have been pulled into the documentation folder.