Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap-multiselect
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap-multiselect
Commits
e641c1d4
Commit
e641c1d4
authored
Oct 09, 2014
by
David HAN SZE CHUEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the input tag type and name with jQuery's attr() method to avoid any string escaping issue
Factorise some code too
parent
81328b18
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+9
-9
No files found.
js/bootstrap-multiselect.js
View file @
e641c1d4
...
...
@@ -340,11 +340,12 @@
this
.
$select
.
children
().
each
(
$
.
proxy
(
function
(
index
,
element
)
{
var
$element
=
$
(
element
);
// Support optgroups and options without a group simultaneously.
var
tag
=
$
(
element
)
.
prop
(
'
tagName
'
)
var
tag
=
$
element
.
prop
(
'
tagName
'
)
.
toLowerCase
();
if
(
$
(
element
)
.
prop
(
'
value
'
)
===
this
.
options
.
selectAllValue
)
{
if
(
$
element
.
prop
(
'
value
'
)
===
this
.
options
.
selectAllValue
)
{
return
;
}
...
...
@@ -353,7 +354,7 @@
}
else
if
(
tag
===
'
option
'
)
{
if
(
$
(
element
)
.
data
(
'
role
'
)
===
'
divider
'
)
{
if
(
$
element
.
data
(
'
role
'
)
===
'
divider
'
)
{
this
.
createDivider
();
}
else
{
...
...
@@ -549,15 +550,14 @@
var
$label
=
$
(
'
label
'
,
$li
);
$label
.
addClass
(
inputType
);
var
$checkbox
=
$
(
'
<input/>
'
).
attr
(
'
type
'
,
inputType
);
if
(
this
.
options
.
checkboxName
)
{
$label
.
append
(
'
<input type="
'
+
inputType
+
'
" name="
'
+
this
.
options
.
checkboxName
+
'
" />
'
);
}
else
{
$label
.
append
(
'
<input type="
'
+
inputType
+
'
" />
'
);
$checkbox
.
attr
(
'
name
'
,
this
.
options
.
checkboxName
);
}
$label
.
append
(
$checkbox
);
var
selected
=
$element
.
prop
(
'
selected
'
)
||
false
;
var
$checkbox
=
$
(
'
input
'
,
$li
);
$checkbox
.
val
(
value
);
if
(
value
===
this
.
options
.
selectAllValue
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment