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
b45532b0
Commit
b45532b0
authored
Mar 14, 2014
by
yuripc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove multiple $(event.target) object creation
parent
a50ba907
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+16
-12
No files found.
js/bootstrap-multiselect.js
View file @
b45532b0
...
...
@@ -319,27 +319,29 @@
// Bind the change event on the dropdown elements.
$
(
'
li input
'
,
this
.
$ul
).
on
(
'
change
'
,
$
.
proxy
(
function
(
event
)
{
var
checked
=
$
(
event
.
target
).
prop
(
'
checked
'
)
||
false
;
var
isSelectAllOption
=
$
(
event
.
target
).
val
()
===
this
.
options
.
selectAllValue
;
var
$target
=
$
(
event
.
target
);
var
checked
=
$target
.
prop
(
'
checked
'
)
||
false
;
var
isSelectAllOption
=
$target
.
val
()
===
this
.
options
.
selectAllValue
;
// Apply or unapply the configured selected class.
if
(
this
.
options
.
selectedClass
)
{
if
(
checked
)
{
$
(
event
.
target
)
.
parents
(
'
li
'
)
$
target
.
parents
(
'
li
'
)
.
addClass
(
this
.
options
.
selectedClass
);
}
else
{
$
(
event
.
target
)
.
parents
(
'
li
'
)
$
target
.
parents
(
'
li
'
)
.
removeClass
(
this
.
options
.
selectedClass
);
}
}
// Get the corresponding option.
var
value
=
$
(
event
.
target
)
.
val
();
var
value
=
$
target
.
val
();
var
$option
=
this
.
getOptionByValue
(
value
);
var
$optionsNotThis
=
$
(
'
option
'
,
this
.
$select
).
not
(
$option
);
var
$checkboxesNotThis
=
$
(
'
input
'
,
this
.
$container
).
not
(
$
(
event
.
target
)
);
var
$checkboxesNotThis
=
$
(
'
input
'
,
this
.
$container
).
not
(
$
target
);
if
(
isSelectAllOption
)
{
if
(
this
.
$select
[
0
][
0
].
value
===
this
.
options
.
selectAllValue
)
{
...
...
@@ -404,19 +406,21 @@
$
(
'
li a
'
,
this
.
$ul
).
on
(
'
touchstart click
'
,
function
(
event
)
{
event
.
stopPropagation
();
var
$target
=
$
(
event
.
target
);
if
(
event
.
shiftKey
)
{
var
checked
=
$
(
event
.
target
)
.
prop
(
'
checked
'
)
||
false
;
var
checked
=
$
target
.
prop
(
'
checked
'
)
||
false
;
if
(
checked
)
{
var
prev
=
$
(
event
.
target
)
.
parents
(
'
li:last
'
)
var
prev
=
$
target
.
parents
(
'
li:last
'
)
.
siblings
(
'
li[class="active"]:first
'
);
var
currentIdx
=
$
(
event
.
target
)
.
parents
(
'
li
'
)
var
currentIdx
=
$
target
.
parents
(
'
li
'
)
.
index
();
var
prevIdx
=
prev
.
index
();
if
(
currentIdx
>
prevIdx
)
{
$
(
event
.
target
)
.
parents
(
"
li:last
"
).
prevUntil
(
prev
).
each
(
$
target
.
parents
(
"
li:last
"
).
prevUntil
(
prev
).
each
(
function
()
{
$
(
this
).
find
(
"
input:first
"
).
prop
(
"
checked
"
,
true
)
.
trigger
(
"
change
"
);
...
...
@@ -424,7 +428,7 @@
);
}
else
{
$
(
event
.
target
)
.
parents
(
"
li:last
"
).
nextUntil
(
prev
).
each
(
$
target
.
parents
(
"
li:last
"
).
nextUntil
(
prev
).
each
(
function
()
{
$
(
this
).
find
(
"
input:first
"
).
prop
(
"
checked
"
,
true
)
.
trigger
(
"
change
"
);
...
...
@@ -434,7 +438,7 @@
}
}
$
(
event
.
target
)
.
blur
();
$
target
.
blur
();
});
// Keyboard support.
...
...
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