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
f113f9a9
Commit
f113f9a9
authored
Apr 16, 2015
by
aqwsez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create collapsibleOptGroups.js
parent
c8351a6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
collapsibleOptGroups.js
dist/js/collapsibleOptGroups.js
+67
-0
No files found.
dist/js/collapsibleOptGroups.js
0 → 100644
View file @
f113f9a9
!
function
(
e
)
{
"
use strict
"
;
jQuery
.
fn
.
multiselect
.
Constructor
.
prototype
.
selectAll
=
(
function
()
{
var
cached_function
=
jQuery
.
fn
.
multiselect
.
Constructor
.
prototype
.
selectAll
;
return
function
()
{
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
);
args
[
0
]
=
(
this
.
options
.
enableCollapsibleOptGroups
&&
this
.
options
.
multiple
)
?
false
:
args
[
0
];
cached_function
.
apply
(
this
,
args
);
};
}());
jQuery
.
fn
.
multiselect
.
Constructor
.
prototype
.
deselectAll
=
(
function
()
{
var
cached_function
=
jQuery
.
fn
.
multiselect
.
Constructor
.
prototype
.
deselectAll
;
return
function
()
{
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
);
args
[
0
]
=
(
this
.
options
.
enableCollapsibleOptGroups
&&
this
.
options
.
multiple
)
?
false
:
args
[
0
];
cached_function
.
apply
(
this
,
args
);
};
}());
jQuery
.
fn
.
multiselect
.
Constructor
.
prototype
.
buildDropdownOptions
=
(
function
()
{
var
cached_function
=
jQuery
.
fn
.
multiselect
.
Constructor
.
prototype
.
buildDropdownOptions
;
return
function
()
{
cached_function
.
apply
(
this
,
arguments
);
if
(
this
.
options
.
enableCollapsibleOptGroups
&&
this
.
options
.
multiple
)
{
e
(
"
li.multiselect-group
"
,
this
.
$ul
).
each
(
function
()
{
var
name
=
$
(
"
label
"
,
this
).
html
();
$
(
this
).
html
(
'
<a href="javascript:void(0);"><input type="checkbox" value="
'
+
name
+
'
"/><b>
'
+
name
+
'
<b class="caret"></b></b></a>
'
);
});
e
(
"
li.multiselect-group
"
,
this
.
$ul
).
siblings
().
not
(
"
li.multiselect-group, li.multiselect-all
"
,
this
.
$ul
).
each
(
function
()
{
$
(
this
).
toggleClass
(
'
hidden
'
,
true
);
});
e
(
"
li.multiselect-group
"
,
this
.
$ul
).
on
(
"
click
"
,
e
.
proxy
(
function
(
t
)
{
t
.
stopPropagation
();
},
this
));
e
(
"
li.multiselect-group > a > b
"
,
this
.
$ul
).
on
(
"
click
"
,
e
.
proxy
(
function
(
t
)
{
t
.
stopPropagation
();
var
n
=
e
(
t
.
target
).
closest
(
'
li
'
);
var
r
=
n
.
nextUntil
(
"
li.multiselect-group
"
);
var
i
=
true
;
r
.
each
(
function
()
{
i
=
i
&&
e
(
this
).
hasClass
(
'
hidden
'
);
});
r
.
toggleClass
(
'
hidden
'
,
!
i
);
},
this
));
e
(
"
li.multiselect-group > a > input
"
,
this
.
$ul
).
on
(
"
change
"
,
e
.
proxy
(
function
(
t
)
{
t
.
stopPropagation
();
var
n
=
e
(
t
.
target
).
closest
(
'
li
'
);
var
r
=
n
.
nextUntil
(
"
li.multiselect-group
"
);
var
i
=
true
;
var
s
=
r
.
find
(
"
input
"
);
s
.
each
(
function
()
{
i
=
i
&&
e
(
this
).
prop
(
"
checked
"
)
});
s
.
prop
(
"
checked
"
,
!
i
).
trigger
(
"
change
"
)
},
this
));
e
(
"
li.multiselect-all
"
,
this
.
$ul
).
css
(
'
background
'
,
'
#f3f3f3
'
).
css
(
'
border-bottom
'
,
'
1px solid #eaeaea
'
);
e
(
"
li.multiselect-group > a, li.multiselect-all > a > label.checkbox
"
,
this
.
$ul
).
css
(
'
padding
'
,
'
3px 20px 3px 35px
'
);
e
(
"
li.multiselect-group > a > input
"
,
this
.
$ul
).
css
(
'
margin
'
,
'
4px 0px 5px -20px
'
);
}
};
}());
}(
window
.
jQuery
)
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