Mihail
381f173e55
Use $.prop() to get "multiple" attribute
...
The string
opts.element.attr("multiple")
returns:
1) string "multiple" - if element have attribute multiple (<select name="..." multiple></select>)
2) undefined - if element have not attribute multiple (<select name="..."></select>)
It is written in the documentation:
"As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set."
"To retrieve and change DOM properties, use the .prop() method."
(http://api.jquery.com/attr/ )
I am propose use "prop" function. The string
opts.element.prop("multiple")
returns:
1) boolean "true" - if element have attribute multiple
2) boolean "false" - if element have not attribute multiple
After, the "multiple" variable use in check of the condition:
select2 = multiple ? new MultiSelect2() : new SingleSelect2();
Better use true/false variable value than "multiple"/undefined in this condition.
Tested in Opera 12 and IE 8.0.7601
2013-03-20 14:19:05 +02:00
bigmihail
8c3f71145e
Create Ukrainian translation file
2013-03-19 22:58:59 +02:00
Igor Vaynberg
a425c124e1
Update README.md
2013-03-19 09:00:39 -07:00
Igor Vaynberg
d482a6ed6a
Update README.md
2013-03-19 08:54:47 -07:00
Igor Vaynberg
96ddc7ad4f
Update README.md
2013-03-19 08:53:36 -07:00
Igor Vaynberg
1de786b8da
Update README.md
2013-03-19 08:53:02 -07:00
Igor Vaynberg
1d2387f1e3
Merge pull request #1056 from dlx1986/bugfix
...
fix a bug when use multi
2013-03-19 08:30:38 -07:00
ZhongYou
6a58e99285
trigger "focus" event in focus function make chrome error:
...
"Uncaught RangeError: Maximum call stack size exceeded"
2013-03-19 18:01:12 +08:00
Igor Vaynberg
6a29e594b6
Merge pull request #1052 from julen/eu-locale
...
Added Basque translation.
2013-03-18 08:18:49 -07:00
Julen Ruiz Aizpuru
2d636d5894
Added Basque translation.
2013-03-18 16:02:55 +01:00
Igor Vaynberg
4530e74e95
Merge pull request #1042 from JensRantil/fix-issue-1042
...
Bugfix: Avoid implosion of empty <option>s
2013-03-15 08:25:06 -07:00
Igor Vaynberg
cbc5106d80
Merge pull request #1043 from Smartik89/master
...
Romanian translation.
2013-03-15 08:18:59 -07:00
Smartik89
24eaac6819
Added Romanian translation
2013-03-15 13:26:42 +02:00
Jens Rantil
eac267b11f
Bugfix: Avoid implosion of empty <option>s
...
When using select2 on
<select>
<option value="empty"></option>
<option>Val 1</option>
<option>Val 2</option>
</select>
The top option will not have the correct height.
2013-03-15 11:15:03 +01:00
Igor Vaynberg
b826b7f5e3
Merge pull request #1035 from millimoose/master
...
Slovak localisation
2013-03-14 14:00:37 -07:00
David Vallner
e66344761b
Create Slovak localisation file
2013-03-14 21:42:54 +01:00
Igor Vaynberg
9acfc6faa5
prevent duplicate queries
2013-03-14 12:47:46 -07:00
Igor Vaynberg
3be8547584
added new loaded event. fixes #930
2013-03-14 12:00:06 -07:00
Igor Vaynberg
86a8190080
Loading icon doesn't disappear when using tags with auto tokenization. fixes #1005
2013-03-14 11:39:45 -07:00
Igor Vaynberg
b973b56cce
Calling select2('open') on multiple select shows 'No Matches Found'.
2013-03-14 11:31:11 -07:00
Igor Vaynberg
911a0bb082
prevent form from being submitted when enter is pressed in multiselect. fixes #961
2013-03-14 11:14:37 -07:00
Igor Vaynberg
dd34cc5d67
always show spinner during searching. fixes #950 fixes #943
2013-03-14 10:00:25 -07:00
Igor Vaynberg
fcce8aaba4
Merge pull request #1032 from JensRantil/make-inline-friendlier
...
Centering select2 vertically
2013-03-14 08:25:08 -07:00
Jens Rantil
518cdf8600
Centering select2 vertically
...
This makes Select2 behave much more sane when it's put inline inbetween
text.
2013-03-14 15:00:09 +01:00
Igor Vaynberg
f60c40d484
Merge pull request #1028 from JensRantil/swedish-translation
...
Swedish translation
2013-03-13 11:13:08 -07:00
Jens Rantil
75dd4a60ff
Swedish translation
2013-03-13 19:06:08 +01:00
Igor Vaynberg
95bbabe5a8
Merge pull request #1025 from JensRantil/enter-less-chars-fix
...
Minor grammar fix
2013-03-13 10:24:41 -07:00
Igor Vaynberg
3b6766c14e
Merge pull request #1026 from JensRantil/translation-process-improvements
...
Translation process improvements
2013-03-13 10:24:05 -07:00
Jens Rantil
84e5cbb154
Suggesting author header in translation files
...
This can be highly useful when a translation need to be updated and you
need to contact an older translator.
2013-03-13 18:01:28 +01:00
Jens Rantil
96d319f9d2
Mentioning i18n in README
...
Should probably be documented on http://ivaynberg.github.com/select2/ ,
too, but I'm not very much of a Jekyll dude.
2013-03-13 17:59:59 +01:00
Jens Rantil
54dbb825a8
Adding a translation template
...
This will make it easier to translate to other languages.
2013-03-13 17:52:17 +01:00
Jens Rantil
5193dc40b9
Fixing grammar
...
I find it hard to "type" less characters. It's sort of unintuitive.
2013-03-13 17:38:34 +01:00
Igor Vaynberg
759fb439fe
Merge pull request #1021 from frntz/master
...
Fix escapeMarkup regexp
2013-03-13 08:03:21 -07:00
frntz
78312ce33f
Slash doesn't escaped
...
Caused problems during uglify minification
2013-03-13 08:40:47 +01:00
Igor Vaynberg
ae4b24a7e8
workaround for IE when manipulating classes. fixes #937 fixes #1017
2013-03-12 09:27:11 -07:00
Igor Vaynberg
89bb328a77
Update README.md
2013-03-12 00:05:18 -07:00
Igor Vaynberg
fb158ed0c8
change how offscreen css is defined. finxes #1011
2013-03-11 16:28:27 -07:00
Igor Vaynberg
814e8b5bed
fix #1000
2013-03-07 16:04:19 -08:00
Igor Vaynberg
3acecf1b9d
Merge pull request #999 from stefandroog/master
...
Dutch language support
2013-03-07 11:31:40 -08:00
Stefan Droog
e31abcf3cb
Dutch language support
...
Dutch language support
2013-03-07 20:24:45 +01:00
Igor Vaynberg
8609bee8f1
fix bug in css
2013-03-05 19:30:54 -08:00
Igor Vaynberg
6ea386bd67
Merge pull request #981 from backstop/master
...
Makes it so we don't query every time we select when maximumSelectionSize is 0
2013-03-05 09:16:34 -08:00
Stephen Starkey
e7f2aeaf08
Don't update results if maximumSelectionSize is 0
...
a maximumSelectionSize of zero means unlimited, which means
we shouldn't be updating results if it's set to 0
2013-03-05 10:31:28 -06:00
Igor Vaynberg
4a3d3c88ac
Merge pull request #972 from kevin-brown/master
...
Added pt-PT localisation
2013-03-04 18:03:33 -08:00
Kevin Brown
27f736cb56
Fixed artifacts in pt-PT translation
2013-03-04 20:35:55 -05:00
Igor Vaynberg
1edfde783c
Merge pull request #974 from nkenneweg/master
...
Bugfix for Resetting Scrollpoint when loading more data.
2013-03-04 08:20:00 -08:00
Nils Kenneweg
414c376a1a
fixed a bug resetting scroll when loading more data.
2013-03-04 13:54:03 +01:00
Kevin Brown
90dc789cd9
Added pt-PT localisation [ Fixes #970 ]
2013-03-03 14:21:11 -05:00
Igor Vaynberg
fb69e3a3f0
Merge pull request #971 from jackyyf/master
...
Chinese Locale Added
2013-03-03 10:12:26 -08:00
Jack Yu
4e676af9f2
Chinese Locale Added
2013-03-04 01:46:06 +08:00