1
0
mirror of synced 2024-11-26 14:56:07 +03:00
Commit Graph

317 Commits

Author SHA1 Message Date
Meir Cohen
7974fd1662 Corrected a few Hebrew translations
About  `errorLoading`:
Before the correction, the translation was: "התוצאות לא נטענו בהלכה".
The word "בהלכה" is wrong and should be spelled "כהלכה", but besides that, this translations means "The results were loaded improperly", while my corrected translation means "Error while loading results", which is what needed.

About `inputTooLong`, `inputTooShort`, `maximumSelected`:
In Hebrew, it's not acceptable to have the digit 1 for representing a single object. You should use the actual word "one", which is "אחד" in Hebrew together with the singular noun (e.g. "one item" / "one character", instead of "1 item" / "1 character").
**These 3 parts needed a critical fix anyway**, because they were addind the English letter 's' to the end of the Hebrew string.

About `loadingMore`:
The translation was "טען תוצאות נוספות" which means "Load more results", as an instruction, probably a typo.
I changed "טען" to "טוען" so now it means "loading more results", which is the correct form.

This closes https://github.com/select2/select2/pull/3911
2015-11-09 17:43:53 -05:00
Kevin Brown
ca0fd7c195 Properly disable input handlers in IE
Previously we were only disabling the `input` handler when it was
triggered, which caused a race condition within the `keyup` handlers
which also was triggered by the `input` event. This fixes the issue by
also unbinding the `input` handlers within the `keyup` handler, to avoid
running into the race condition.

Thanks to @Eckankar for pointing out the race condition that still
existed in
66ae2ad1d5

This closes https://github.com/select2/select2/issues/3300
2015-11-09 17:33:30 -05:00
Shawn
f3a29b87e1 Fixes and issue where If args are not present script terminates 2015-10-19 15:34:44 -07:00
Chris Rodgers
441fbc2d73 Method called using apply to avoid translating multiple args into single arg. Fixes #3756 2015-09-10 12:05:25 +01:00
Kevin Brown
eb47f638d3 Merge pull request #3698 from jbrown/patch-1
Fix typo
2015-08-25 11:35:09 -04:00
Kevin Brown
89858c418d Implement Dropdown.bind
This closes https://github.com/select2/select2/issues/3239
2015-08-21 20:51:42 -04:00
Kevin Brown
73e50ae92c Hide messages when loading results
This closes https://github.com/select2/select2/issues/3343
2015-08-21 20:49:01 -04:00
Kevin Brown
49589611ee Handle null being returned from createTag
The `createTag` option does allow for `null` to be returned if a
tag should not be created. The tokenizer previously didn't support
this, so the tokenizer should be able to handle this case. Previously
it would trigger an exception, because the tokenizer would pass back
a null value to the select function.

This also fixes what would have been a potential bug where even if a
tag was not created, the term would still have been sliced at the
location of the token. This allows for tokenizers to have special
cases when tokenizing the term, such as not splittting a token
if it is in the middle of a quoted string.

This closes https://github.com/select2/select2/issues/3593
This closes https://github.com/select2/select2/pull/3591
2015-08-21 19:12:13 -04:00
Stretch
d08cb874f9 Trigger the select event in the tokenizer
This closes https://github.com/select2/select2/issues/3325.
This closes https://github.com/select2/select2/pull/3453.
2015-08-21 18:30:35 -04:00
Kevin Brown
7166935958 Always pass in a blank object for arguments
This fixes an issue where preventing the default behaviour on some
events would trigger an exception. This was bacause the event relay
was expecting there to always be an object passed in for arguments,
and this wasn't always the case.

This closes https://github.com/select2/select2/issues/3431.
2015-08-21 17:43:50 -04:00
Kevin Brown
66ae2ad1d5 Fix input event in IE
This closes https://github.com/select2/select2/issues/3300
This closes https://github.com/select2/select2/pull/3677
2015-08-21 14:46:50 -04:00
Justin Brown
dac09005ad Fix typo 2015-08-20 13:15:57 -04:00
Bart Pelle
eee70fd9af Fix improper grammar in Dutch i18n file
Grammar is incorrect when maximum is 1, 'kunnen' should be 'kan' in that case.
2015-08-20 09:21:52 +02:00
Kevin Brown
1587708826 Merge pull request #3507 from RyanDale/issue-3503
Fixes #3503: Removes redundant 'open' event trigger
2015-08-19 22:44:30 -04:00
Kevin Brown
68d068f1d2 Prevent selections from being removed when disabled
This prevents selections from being removed when the container is
disabled. This stops any click events that are triggered on the
remove button, so the remove handler won't be triggered at all.

This closes https://github.com/select2/select2/pull/3636.
2015-08-19 21:01:19 -04:00
Kevin Brown
671f5a2ce2 Fix memory leak in AttachBody
The `$dropdownContainer` variable wasn't being cleaned up when
Select2 was destroyed, which was causing a memory leak.

This closes https://github.com/select2/select2/issues/3559.
This closes https://github.com/select2/select2/pull/3603.
2015-08-19 20:07:51 -04:00
Kevin Brown
700f7908fc Merge pull request #3654 from wdietz/master
Fix IE 8-11 not showing Chinese characters
2015-08-19 10:26:10 -04:00
Kevin Brown
47895b1e45 Merge pull request #3565 from rockshandy/issue-3564
use merged data instead of existingData for ArrayAdapter
2015-08-11 18:22:40 -04:00
Wayne Dietz
d37d6d6cac Fix issue in IE 8-11 that prevents typing characters that require multiple key presses to produce a single glyph. 2015-08-06 10:17:03 -05:00
Salahuddin Hairai
fd9ab0665d Updated Indonesian translation 2015-08-01 15:36:45 +08:00
Salahuddin Hairai
00e98e8afc Add Malay translation 2015-08-01 15:34:36 +08:00
Michał Zalewski
74bb22939a Fixed typo in maximum selected message 2015-07-18 10:19:10 +02:00
Phil Eberhardt
f5593e12e4 use merged newData in case where an option already exists when using ArrayAdapter 2015-07-09 18:40:56 -04:00
Stretch
698fe7b9e1 Focus is lost when the change event is triggered
This closes https://github.com/select2/select2/issues/3332.
2015-06-21 21:40:50 -04:00
Ryan Dale
d2346cc331 Change ALT + UP to close the dropdown instead of opening it
This closes https://github.com/select2/select2/issues/3471.
2015-06-21 20:47:05 -04:00
Kevin Brown
79cdcc0956 Fix focus wars in multiple selects
In the previous commit (02cca7b) support was added for multiple
selects to automatically focus when they were tabbed into. While
this did actually work, it caused a few bugs with the focus that
prevented users from tabbing out of the container, effectively
trapping keyboard users in Select2.

This makes a few major changes to how things work in Select2, but
should not break any backwards compatibility.

 - The internal `focus` event is now proxied through a `focus`
   method on the core object. This allows for two important things

   1. The `focus` event will only be triggered if Select2 was in an
      unfocused state.
   2. Select2 now (unofficially) supports the `select2('focus')`
      method again.

   But that does mean that it is possible to trigger the `focus`
   event now and not have it propagate throughout the widget. As
   it would previously trigger multiple times, even when Select2
   had not actually lost focus, this is considered a fix to a bug
   instead of a breaking change.

 - The internal `blur` event in selections is only triggered when
   the focus is moved off of all elements within the selection. This
   allows for better tracking of where the focus is within Select2,
   but as a result of the asynchronous approach it does mean that the
   `blur` event is not necessarily synchronous and may be more
   difficult to trace.

 - On multiple selects, the standard selection container is never
   visually focused. Instead, the focus is always shifted over to
   the search box when it is requested. The tab index of the selection
   container is also always copied to the search box, so the search
   will always be in the tab order instead of the selection container.

It's important to note that these changes to the tab order and how
the focus is shifted do not apply to multiple selects that do not
have a search box. Those changes also do not apply to single select
boxes, which will still have the same focus and tabbing behaviours
as they previously did.
2015-06-21 20:07:35 -04:00
Ryan Dale
c5a54ed706 Fixes #3503: Removes redundant 'open' event trigger 2015-06-21 16:30:20 -04:00
Ryan Wallace
02cca7baa7 Allow immediate typing when tabbing to multiple select. 2015-06-21 14:16:31 -04:00
Quentin Pradet
5efdc35aeb Replace tabs with spaces for consistency 2015-06-18 10:19:56 +02:00
Seigo ISHINO
2dcc9ef18b Add Japanese translation 2015-06-15 14:30:08 +09:00
Kevin Brown
d7e137f8a8 Merge pull request #3464 from molily/issues/3446
ContainerCss: Remove magic `:all:` correctly. Fixes #3446.
2015-06-11 09:44:22 -04:00
Mathias Schaefer (molily)
d130bd4fa7 DropdownCSS: Remove magic :all: correctly. 2015-06-11 12:09:02 +02:00
Kevin Brown
04a4e41504 Merge pull request #3324 from stretch4x4/MultiSelectStyling
Adding container support issue #3222
2015-06-10 20:09:28 -04:00
Mathias Schaefer (molily)
62b2391972 ContainerCss: Remove magic :all: correctly. Fixes #3446. 2015-06-10 23:15:43 +02:00
Stretch
e60ab22a85 Adding single select support and testing 2015-06-10 20:05:07 +10:00
Jason
da5a72c3ac Fixed AjaxAdapter's super constructor call
Replaced ArrayAdapter super constructor call with correct AjaxAdapter super constructor call. This will allow users to initialize an Ajax select with data.
2015-05-19 16:10:16 -07:00
Stretch
13cead0bd0 Adding container support #3222
Fixes issue #3222
Now templateSelection can have access to the parent container so that
classes can be added for styling
2015-05-07 21:59:51 +10:00
Aitor García Rey
42075c6233 Swap inputTooLong and inputTooShort error messages
"Engada"  in galician is "to add" and therefore should be the base text used for the inputTooShort method, asking the use to add more chars. It seems to be mistakenly defined exactly the opposite it should be (as inputTooLong was containing the right text).
2015-04-27 17:20:03 +00:00
nath
e416e47356 Added back dropdownAutoWidth option
This adds back the `dropdownAutoWidth` option, so the dropdown can
have a width that is automatically determined by the browser. This
works best for smaller dropdowns that contain options with large
amounts of text.

This closes https://github.com/select2/select2/issues/3103.
This closes https://github.com/select2/select2/pull/3113.

Signed-off-by: Kevin Brown <kevin@kevin-brown.com>
2015-04-26 16:55:22 -04:00
Andrew Ognistyi
d6886fe6dd added translation for errorLoading 2015-04-22 19:32:45 +03:00
Kevin Brown
f3f1b31958 Add back *css* options through an adapter
The old functionality where classes were directly copied to the
container can be done by setting `dropdownCssClass: ':all:'` when
initializing Select2.

This closes https://github.com/select2/select2/issues/2879.
2015-04-05 21:58:02 -04:00
Kevin Brown
4fc874a3ae Improve jQuery performance issues
This improves a regression added in b9b55cec44
that reduced performance for large number of options when using a
jQuery collection object to append multiple options instead of
using a bare array containing the jQuery elements.

As `$.fn.add` is only required for jQuery 1.7.x, we can use a
utility function that only falls back to it for that specific
version of jQuery, and uses `$.fn.append` with an array for all
other versions.

This closes https://github.com/select2/select2/issues/3230.
2015-04-05 20:08:33 -04:00
penihel
c24293f2ba Render native select out of screen
This closes https://github.com/select2/select2/issues/3065.

Signed-off-by: Kevin Brown <kevin@kevinbrown.in>
2015-04-02 12:01:32 -04:00
Kevin Brown
a993ed9ca9 Warn when Select2 is called without being initalized
Since Select2 methods should not be called on an element where
Select2 has not yet been initialized, this raises an error when it
happens.  This does not silence the original error, but it does
provide the user with some more context about why they are seeing
a TypeError.

This closes https://github.com/select2/select2/issues/3173.
2015-04-02 11:41:18 -04:00
Kevin Brown
e7498987a5 Fix abort with JSONP
We now check that the `abort` method actually exists before aborting
the request, as JSONP does not include the `abort` method because
a JSONP request technically cannot be aborted.

This closes https://github.com/select2/select2/issues/3217.
2015-04-02 11:26:23 -04:00
Kevin Brown
a8e6cbc0c9 Add back keyboard support within allowClear
This adds back keyboard support, so you can now clear a selected
item using either the backspace or delete key.  This only work when
the container is closed, to prevent issues with the selection being
clear while a user is searching.

This was a regression in accessibility from 3.x.

This closes https://github.com/select2/select2/issues/3224.
2015-04-02 11:21:10 -04:00
Kevin Brown
00a78bdb1e Allow for a partial dictionary in language
This closes https://github.com/select2/select2/issues/3202.
2015-04-02 10:52:31 -04:00
Kevin Brown
01160f29d8 Allow chaining of .select2()
`.select2("open")`, `.select2("close")`, and `.select2("destroy")`
can now be safely chained.

This closes https://github.com/select2/select2/issues/3221.
2015-04-02 10:34:30 -04:00
jongwoo Yoo
da1ec4e028 fix error: "Uncaught ReferenceError: require is not defined"
Signed-off-by: Kevin Brown <kevin@kevinbrown.in>
2015-04-02 10:29:22 -04:00
Brankub
010cf29902 switched back to this instead of self 2015-03-25 10:07:55 +02:00