1
0
mirror of synced 2024-11-24 05:46:09 +03:00
Commit Graph

2146 Commits

Author SHA1 Message Date
Kevin Brown
083c2112df Merge pull request #4389 from anasshekhamis/master
Correct typo in "options" page
2016-06-11 19:47:14 -04:00
Anas Shekhamis
ffe780db53 Correct typo in "options" page
Correct a typo in the "options" page, "Data Adapters" section, "Do the
id properties have to be strings?" part.
">select<" to "<select>"
2016-05-29 12:36:00 +03:00
Kevin Brown
566c7846fb Update version identifiers for 4.0.3 2016-05-26 21:16:06 -04:00
Kevin Brown
24a8d73a99 Recompile dist 2016-05-26 20:53:18 -04:00
Kevin Brown
2343fd4ae4 Clarify the Bootstrap docs notice with the dropdownParent option
This closes https://github.com/select2/select2/pull/4253.
2016-05-26 20:52:37 -04:00
Kevin Brown
8bc4f5d41d Added createTag code samples
This lays down part of the path for
https://github.com/select2/select2/issues/4023 as well as
https://github.com/select2/select2/issues/3974.
2016-05-26 20:50:12 -04:00
Harry
7eab29e271 Added Greek (el) translation
Translated English (en) language file to Greek (el).

This closes https://github.com/select2/select2/pull/4139
This closes https://github.com/select2/select2/pull/4146
2016-05-26 20:36:22 -04:00
Kevin Brown
7505347a69 Merge pull request #4379 from petruavram/master
[Docs] Add favicon
2016-05-26 20:25:39 -04:00
Petru-Vasile Avram
d34bff5797 Add favicon
I used the logo image on the site to generate a favicon using
[Real
Favicon Generator tool](http://realfavicongenerator.net/).
2016-05-25 10:25:47 +03:00
Kevin Brown
a74547aaa7 Migrate from expect to assert.expect
After we upgraded to QUnit 1.23.1, we gained support for
assert.expect(). This allows us to guard against any race conditions
within tests, because now expect() will be linked to the specific test
instead of the current running test.
2016-05-23 23:38:45 -04:00
Kevin Brown
2805fa7aa4 Add tests for detecting added and removed options
This adds tests for ea79a197e0.
2016-05-23 23:32:02 -04:00
Kevin Brown
ea79a197e0 Select2 now detects added and removed options
Select2 will now automatically update the selection if there are options
added to or removed from the DOM within the `<select>` element. This is
supported in all browsers except for Internet Explorer 8. Internet
Explorer 8 does not support the DOM mutation events which were added in
Internet Explorer 9, and it does not support mutation observers which
are the recommended way of handling this in modern browsers.

DOM mutation events also trigger for the `<select>` itself when it is
pulled from the DOM, so we need to filter these out within the event
handler.

Despite supporting mutation observers, we cannot accurately detect if
the removed option was selected at one time or another, so we need to
always re-pull the selection when an element is deleted.

This closes https://github.com/select2/select2/issues/4248
This builds upon https://github.com/select2/select2/pull/4249
2016-05-23 23:31:17 -04:00
Kevin Brown
a75482fd30 Upgrades QUnit to 1.23.1
This was required for us to get assert.async() support within tests, as
well as assert.expect() support. This was required because we need them
for multiple async tests that are coming.
2016-05-23 23:25:13 -04:00
Kevin Brown
99c248cc34 Recompiled dist 2016-05-14 22:34:03 -04:00
Kevin Brown
4b9e02f022 Corrected check for opening the dropdown
This corrects the check that was used when the dropdown was opened, so
the results would be immediately rendered instead of delaying the
loading. Previously it would delay the immediate load but immediately
load the results when the search term was emptied.

This closes https://github.com/select2/select2/issues/4191
This closes https://github.com/select2/select2/pull/4192
This closes https://github.com/select2/select2/pull/4202
2016-05-14 22:26:56 -04:00
Kevin Brown
481c43883e selectOnClose now properly works with closeOnSelect
Previously we hacked around the infinite loop between closeOnSelect and
selectOnClose by attempting to detect what event was being triggered
without knowing what event triggered it. Now we properly relay the
Select2 event and the jQuery event that triggered the select or unselect

This closes https://github.com/select2/select2/issues/4012
2016-05-14 22:14:20 -04:00
Kevin Brown
ad8447cc35 Add a new _type parameter for the first event argument
This will include the event type in the _type property, so it can be
accessed within the event handlers if it's not normally passed in. This
should not conflict with any existing handlers, and this should not be
considered a public property on event arguments.
2016-05-14 22:01:42 -04:00
Kevin Brown
acd3306192 Added tests for focusing results
This adds three tests related to focusing selected items in the results.
The tests are for e897d00 and 9f58128.
2016-05-14 21:05:30 -04:00
Kevin Brown
9f581285d8 Renamed focusFirstItem method
This renames the `focusFirstItem` method to `highlightFirstItem`, which
better reflects what is actually happening. This also ensures that the
highlight is visible when it is moved by calling
`ensureHighlightVisible`.

This closes https://github.com/select2/select2/issues/3479
This closes https://github.com/select2/select2/pull/4238
2016-05-14 21:05:14 -04:00
Alexander Leonov
e897d008a6 Fixed infinite scrolling issue using down key. 2016-05-14 21:04:31 -04:00
Kevin Brown
07aa8a45b0 Merge pull request #4342 from damienfinck/master
Add missing French translation
2016-05-04 17:30:29 -04:00
Damien Finck
b1ea28bb7d Add missing French translation 2016-05-04 19:55:01 +02:00
Kevin Brown
3663b44b83 Merge pull request #4338 from murb/lt-file-jshint-fix
linting fix for lt i18n file
2016-05-02 22:03:03 -04:00
Maarten Brouwers
89dcfef94b linting fix for lt i18n file 2016-05-03 00:08:06 +02:00
Kevin Brown
f3b91d0680 Recompile dist with master 2016-04-24 12:21:53 -04:00
Aurelijus Rožėnas
5b5eddd183 Fixed broken lithuanian translation
This closes https://github.com/select2/select2/issues/4301.

Signed-off-by: Kevin Brown <kevin@kevin-brown.com>
2016-04-23 22:33:22 -04:00
Kevin Brown
5a831afb9a Added documentation for ajax.url
This closes https://github.com/select2/select2/issues/4213.
2016-04-23 22:23:04 -04:00
Kevin Brown
5b207b287e Add test for focus event on inline search
This adds a test for
02cca7baa7.
2016-04-23 21:38:41 -04:00
Kevin Brown
3bc7f4ac78 Added docs section for HTML labels
This will make it easier in the future to test that we support labels,
and it tells people who are looking to confirm that we support labels
that we in fact do.
2016-04-23 20:36:39 -04:00
Kevin Brown
31e7a1d4c5 Support the focus event on the <select> element
This adds basic support for focusing the Select2 element by triggering
the `focus` event on the underlying <select> element.  This implicitly
adds support for <label> elements, which will trigger the `focus` event
on the `<select>` if it is clicked.

This also fixes the focus issue that previously existed if Select2 was
opened while in a <label>. The focus would be transferred to the search
dropdown, and then immediately pulled away to the <select> element. This
happened because the <label> element triggers the `focus` event when a
`click` event propagates its way up, and we do not stop the propagation
of the `click` event when it is triggered on the selection.

This closes https://github.com/select2/select2/issues/2311.
This closes https://github.com/select2/select2/issues/4203.
This closes https://github.com/select2/select2/pull/4235.
2016-04-23 19:58:04 -04:00
Kevin Brown
b10976bd25 Merge pull request #4318 from acorncom/patch-1
Updated old select2-bootstrap-theme link
2016-04-20 14:03:58 -04:00
David Baker
64a79c3a5b Updated old select2-bootstrap-theme link 2016-04-20 11:11:20 -06:00
Kevin Brown
98f054fc18 Tune the tests for positioning
These tests did not cover the classes that should have been
automatically applied to the dropdown based on the space around it. Now
they both test that the dropdown should be facing down, because there is
enough space below it to display the dropdown.
2016-04-17 17:15:44 -04:00
Ryan Cousart
ecdc416635 Fixing bug with non-static parents for dropdowns
The offset of the parent was only being subtracted if the dropdown was
facing down, this now subtracts it if the dropdown is facing up as well.
This more or less applies the same fix as
e260860789,
but when calculating the position of the dropdown when it is facing up.

This closes https://github.com/select2/select2/issues/3303
This closes https://github.com/select2/select2/pull/4267
2016-04-17 16:58:01 -04:00
Kevin Brown
c099755012 Merge pull request #4246 from somethvictory/master
add Khmer translation
2016-04-14 17:54:48 -04:00
Kevin Brown
120672dce7 Added tests for multiple tags and tokenizing
This adds tests to ensure that 3b8cd2e369
will continue to work in the future.
2016-03-27 18:37:27 -04:00
Kevin Brown
3b8cd2e369 Create an option when tokenizing if needed
Previously the tokenizer only worked when creating multiple options
at once if all of the options existed. It always worked when creating
a single option, because all of the special cases were handled by the
tagging module. When working with multiple options, the tagging
module does not kick in until after the query has been run, which
is when the tokenizer does its magic.

This fixes the issue by automatically creating the option tags that
the tagging module would normally create. It only does this if the
options do not already exist, so we don't need to worry about the
tokenizer creating duplicates of existing options.

This closes https://github.com/select2/select2/issues/3458
2016-03-27 18:29:01 -04:00
Kevin Brown
cfb66f5e4f Attempt to detect aborted requests
The error handler should not be raised if a request is aborted while
another one is sent out. This attempts to detect those cases by
handling the case where the error was raised and the request has a
status code of 0, which should either mean we're in offline mode or
the request was aborted.

This closes https://github.com/select2/select2/issues/4205
2016-03-27 15:44:40 -04:00
Kevin Brown
fe26b083eb Fix dropdownAutoWidth so it actually works
Previously the `dropdownAutoWidth` option didn't work because the
dropdown was being absolutely positioned, so setting the width to
`auto` didn't actually have an effect. This cannot be solved by
just setting the width on the container, because that is also
absolutely positioned.

This closes https://github.com/select2/select2/issues/3101
2016-03-27 15:24:37 -04:00
Kevin Brown
ac254ff68d Added tests for jQuery calls to Select2
This adds a test that covers the change made in
c2c1aeef31.
2016-03-27 15:16:22 -04:00
Kevin Brown
c2c1aeef31 Fix calling select2('', args) on multiple elements
This fixes an issue that has existed since Select2 4.0.1 where the
arguments passed into each `<select>` were mutated. This no longer
mutates the arguments for each element, and instead only drops the
first argument once.

This closes https://github.com/select2/select2/issues/4245
2016-03-27 14:59:44 -04:00
jpic
8869b170b1 Set list-style further down the DOM
This closes https://github.com/select2/select2/issues/4225
This closes https://github.com/select2/select2/pull/4226
2016-03-27 14:55:21 -04:00
Kevin Brown
84d6b5d840 Added small example of attaching event listeners
This closes https://github.com/select2/select2/pull/4255
2016-03-27 14:47:06 -04:00
Kevin Brown
962fd63a67 Stub question about event data 2016-03-27 14:46:29 -04:00
Kevin Brown
78cac8972a Merge pull request #4259 from zapodot/master
Added missing Norwegian bokmaal label used for errors
2016-03-27 14:38:11 -04:00
Sondre Eikanger Kvalø
0212edda95 Added missing Norwegian bokmaal label used for errors 2016-03-16 15:51:39 +01:00
Someth Victory
a7738c4517 fix jshint: Line is too long 2016-03-10 16:45:27 +07:00
Someth Victory
a797833e10 add Khmer translation 2016-03-10 16:35:09 +07:00
Kevin Brown
6844be777b Missed a version identifier 2016-03-08 20:42:47 -05:00
Kevin Brown
622a619d25 Updated version identifiers for 4.0.2 2016-03-08 20:33:38 -05:00