1
0
mirror of synced 2024-11-30 00:26:03 +03:00
Commit Graph

804 Commits

Author SHA1 Message Date
Kevin Brown
db7cd1b373 Go back to hiding the original element
This was only done to maintain compatibility with labels, back
when we could capture the focus events from the original element.
Now that we handle them in a different way, this is no longer
needed.

This fixes #2769.
2014-11-01 14:39:06 -04:00
Kevin Brown
1de4be3749 Fixed TypeError when destroying Select2
This fixes #2587.
2014-10-31 18:15:32 -04:00
Kevin Brown
7581fa5708 Merge pull request #2588 from fabdouglas/patch-8
Redirect the focus of original input to Select2
2014-10-31 18:13:47 -04:00
Kevin Brown
dd323687f3 Merge pull request #2364 from joshuajonah/master
Stopped refresh to top when `closeOnSelect: false`
2014-10-24 18:27:25 -04:00
Kevin Brown
5a184921b6 Merge pull request #2726 from KayLeung/patch-1
Fixes results count in accessible text
2014-10-16 17:41:22 -04:00
Arthur
35f706afbd fixing minor errors e.g. redefined variable 2014-10-16 14:27:19 +03:00
Kevin Brown
ea266346be Merge pull request #2665 from bor0/master
Items with spaces can be added infinite times on multiselects
2014-10-13 20:39:17 -04:00
Dementiy Kalkov
e716ad01e1 'document.body' instead of 'body' selector 2014-10-10 13:32:58 +04:00
Kay.L
b7a7dd064e Fixes results count in accessible text
Only counts the selectable items in the list. (filter out selected item)
2014-10-09 13:36:00 +08:00
Kevin Brown
c1df0aa942 Merge pull request #2702 from dgroux/master
allow formatSelection to return a jQuery object
2014-10-08 21:12:01 -04:00
Boro Sitnikovski
8644ccb68b Items with spaces can be added infinite times on multiselects
Add optional parameter transformVal that allows the user to define transformation for splitVal

Example demos:
(Infinite spaces, default transformVal):
http://jsfiddle.net/DV23t/9/

(No infinite spaces, transformVal = function (x) { return x; }):
http://jsfiddle.net/DV23t/12/
2014-10-08 23:28:41 +02:00
Vitor Oliveira
4955be239d Testing if the object exists before use it
It's necessary to make the code compatible with IE8 and IE9.
2014-10-07 13:07:58 -03:00
Dylan Roux
d385dc512e allow formatSelection to return a jQuery object 2014-09-26 15:14:19 +02:00
Kevin Brown
c5c42eaf72 Merge pull request #2695 from junhanamaki/master
allow markups of subsequent formatLoadMore message
2014-09-25 16:45:59 -04:00
junhanamaki
68070d0cac allow markups of subsequent formatLoadMore message
- setting message with html instead of text
- invoking escapeMarkup method before setting message
2014-09-23 20:48:18 +01:00
romille
633d4e6b4b fixes cutoff for bottom option when selecting with keyboard 2014-09-11 17:45:59 -04:00
Oshane Bailey
9207f23073 Fixed JS breakage due to undefined variable, viewPortLeft. 2014-08-26 22:24:33 -05:00
Kevin Brown
93157214ad Merge pull request #2415 from santialbo/text-function
Add text function for formatResult and formatSelection
2014-08-22 18:37:07 -04:00
Kevin Brown
7505bb6d60 Merge pull request #2595 from scotam/drop-left-check
Adds check for enough room before switching right to left drop
2014-08-22 18:23:18 -04:00
Kevin Brown
2e5538318e Merge pull request #2610 from torke1/patch-1
Prevent multiple select2-hidden-accessible span's
2014-08-21 18:58:17 -04:00
Kevin Brown
4645183054 Merge pull request #2227 from fabdouglas/patch-6
Ignore focus and error on IE7 for disabled select2
2014-08-17 16:49:25 -04:00
Mickael Perraud
afdb0da5f3 Syntax error with IE embedded as ActiveX in fat client
Syntax error with IE embedded as ActiveX in fat client
2014-08-14 13:59:09 +02:00
torke1
651047d52a Issue #2412
Maybe the fix is a bit ugly, but what it does is to make sure that we don't already have a select2-hidden-accessible span before we create a new one. Tested in several scenarios in our application and has solved the issue for us.
2014-08-13 17:27:07 +02:00
Rhodri Pugh
d2c9b9aac3 only switch right to left drop when enough room available 2014-08-07 11:48:55 +01:00
Fabrice Daugan
9d19b7f701 Redirect the focus of original input to Select2
Redirect the focus of original input to the "focus" event of Select2.
this way, we get back the accessible label for feature of previous Select2 versions.
2014-08-04 22:50:22 +02:00
Phazeshift
39382fab08 Fixing 'Type mismatch' exception in destroy in IE11 2014-08-01 12:19:19 +01:00
Jonas Pyfferoen
837715f939 Fixes #2278
Instead of instantly applying the translations, add them to an array.
That way users can include the language files that their site supports
and apply the required language using $.extend($.fn.select2.defaults,
$.fn.select2.locales["nl"]);

Signed-off-by: Kevin Brown <kevin@kevinbrown.in>
2014-07-01 19:17:20 -04:00
Kevin Brown
79b5bf6db9 Merge pull request #2483 from hitosu/master
filter 229 keyCodes (input method editor is processing key input)
2014-06-26 20:18:09 -04:00
Ermish
b505601629 Added Ajax Error Handling
Added an error message when an ajax error occurs. This can be
overridden through the select2 option “formatAjaxError”.
2014-06-25 19:40:08 -04:00
Vasily Kazantsev
7c1ceb8fd9 filter 229 keyCodes (input method editor is processing key input) 2014-06-22 19:07:36 +03:00
Siegfried Bilstein
2690053010 Fixes #2434 Tagging support allows creation of tags that are only whitespace 2014-06-21 11:37:53 -07:00
Kevin Brown
a73d1b2b52 Merge pull request #2465 from rvitaliy/patch-1
fixed destroy
2014-06-17 21:00:51 -04:00
tjperovich
c0cc6c9f94 Fix there/their typo 2014-06-17 10:11:09 -04:00
Vitaliy Ryaboy
78526a3860 Update select2.js
fixed destroy
2014-06-17 13:47:31 +02:00
Kevin Brown
5a7d250071 Merge pull request #2444 from surgeforward/undefined-top
Fix error: Cannot read property 'top' of undefined
2014-06-15 16:22:04 -04:00
Kevin Brown
3fee8fc7e6 Detect classes separated by multiple spaces
This detects classes separated by multiple spaces and will trim
extra spaces surrounding the class attribute.

This closes the following issue: https://github.com/ivaynberg/select2/issues/2358
2014-06-11 20:08:57 -04:00
Kevin Brown
9e17f63013 Normalized select2-selecting event
This normalizes the `select2-selecting` event so the object is
returned as `choice` in the event data.  While the documentation
points to the name being `object`, all other events return the
affected data object as `choice`.

This closes the following issue: https://github.com/ivaynberg/select2/issues/2340
2014-06-11 20:02:23 -04:00
Kevin Brown
b13c9b474d Small formatMatches change for single results
This changes `formatMatches` to notify the user that they can
select the single result.  This is a more clear result compared to
the previous one.

This closes the following issue: https://github.com/ivaynberg/select2/issues/2329
2014-06-11 19:52:08 -04:00
Cameron Spear
0675805621 Fix error: Cannot read property 'top' of undefined
Lines [1499](d487fc58a8/select2.js (L1499)) and [1509](d487fc58a8/select2.js (L1509)) make a call to `child.offset().top`. I don't know what's causing `child.offset()` to return undefined, but it is and it's breaking Select2 so that I can't select the last item in the list (this error occurs when I try hovering over or clicking on the last item in a list).

I can try and create a reduced case, but this fix is 100% backward compatibe, passes all the tests you have for the project and has a 0% chance of breaking anyone's working code. With this patch, my dropdown works just fine. At worst, this does *nothing* for people, at best, it fixes a rare edge case. Like my edge case. And I'm a pretty important person to me.
2014-06-06 19:04:14 -07:00
Santi Albo
db86f19552 Remove added line 2014-05-28 18:17:31 +01:00
Santi Albo
b8ce36a65e Add text function for formatResult and formatSelection 2014-05-28 18:13:26 +01:00
Kevin Brown
d487fc58a8 Merge pull request #2360 from ycdtosa/master
changes on updateResults, populate by @cervengoc on #781
2014-05-27 19:09:38 -04:00
Kevin Brown
f544f9d9ab Merge pull request #2367 from gschizas/master
Added Greek accented characters to ignorable diacritics
2014-05-27 18:56:07 -04:00
Kevin Brown
fba74e3ccd Merge pull request #2363 from thereloaded/master
query as third parameter to ajax results callback
2014-05-27 16:50:52 -04:00
Braden M. Kelley
88c6a63937 IE8 does not support Array.prototype.forEach #2339 2014-05-23 10:29:25 -07:00
Cyril Nicodème
02d6e88747 Update select2.js
Fix an exception when called "destroy" on a still opened dropdown.
2014-05-20 09:30:35 +02:00
TheSisb
e2cd841fe8 Handling mousemove more delicately
Mousemove fires very frequently and is a sure way of killing any app's FPS.  This tweak makes sure it is only bound when it is in fact needed.
2014-05-14 15:25:05 -07:00
George Schizas
827a549ba8 Reverted formatting of diacritics variable, now is again in one line 2014-05-13 17:11:14 +03:00
George Schizas
68c64a1129 Enabled Greek for diacritics ignoring 2014-05-13 17:05:46 +03:00
George Schizas
df43e1a1ec fixed word wrapping for DIACRITICS variable 2014-05-13 16:59:41 +03:00