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
7be7b939
Commit
7be7b939
authored
Apr 25, 2013
by
Luís Rudge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding the search textbox outisde of the same ul container
parent
55434cce
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
208 additions
and
203 deletions
+208
-203
index.html
index.html
+196
-191
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+12
-12
No files found.
index.html
View file @
7be7b939
This diff is collapsed.
Click to expand it.
js/bootstrap-multiselect.js
View file @
7be7b939
...
...
@@ -52,11 +52,11 @@
this
.
options
.
multiple
=
this
.
$select
.
attr
(
'
multiple
'
)
==
"
multiple
"
;
this
.
$container
=
$
(
this
.
options
.
buttonContainer
)
.
append
(
'
<button type="button" class="multiselect dropdown-toggle
'
+
this
.
options
.
buttonClass
+
'
" data-toggle="dropdown">
'
+
this
.
options
.
buttonText
(
this
.
getSelected
(),
this
.
$select
)
+
'
</button>
'
)
.
append
(
'
<ul class="dropdown-menu
'
+
(
this
.
options
.
dropRight
?
'
pull-right
'
:
''
)
+
'
"></ul
>
'
);
.
append
(
'
<button type="button" class="multiselect dropdown-toggle
'
+
this
.
options
.
buttonClass
+
'
" data-toggle="dropdown">
'
+
this
.
options
.
buttonText
(
this
.
getSelected
(),
this
.
$select
)
+
'
</button>
'
)
.
append
(
'
<div id="dropdown-container" class="dropdown-menu" style="position:absolute;"><ul style="list-style-type: none;margin:0;padding:0;"></ul></div
>
'
);
if
(
this
.
options
.
enableFiltering
)
{
$
(
'
ul
'
,
this
.
$container
).
prepend
(
'
<div class="input-prepend" style="padding:3px;"><span class="add-on"><i class="icon-search"></i></span><input id="multiselect-default-search" type="text" placeholder="
'
+
this
.
options
.
filterPlaceholder
+
'
"></div>
'
);
$
(
'
#dropdown-container
'
,
this
.
$container
).
prepend
(
'
<div class="input-prepend" style="padding:3px;"><span class="add-on"><i class="icon-search"></i></span><input id="multiselect-default-search" type="text" placeholder="
'
+
this
.
options
.
filterPlaceholder
+
'
"></div>
'
);
$
(
'
#multiselect-default-search
'
,
this
.
$container
).
val
(
this
.
query
).
click
(
function
(
event
)
{
event
.
stopPropagation
();
}).
keydown
(
$
.
proxy
(
function
(
event
)
{
...
...
@@ -78,7 +78,7 @@
// Set max height of dropdown menu to activate auto scrollbar.
if
(
this
.
options
.
maxHeight
)
{
$
(
'
ul
'
,
this
.
$container
).
css
({
$
(
'
#dropdown-container
ul
'
,
this
.
$container
).
css
({
'
max-height
'
:
this
.
options
.
maxHeight
+
'
px
'
,
'
overflow-y
'
:
'
auto
'
,
'
overflow-x
'
:
'
hidden
'
...
...
@@ -158,7 +158,7 @@
if
(
value
==
'
select-all-option
'
)
$checkbox
.
parent
().
parent
().
addClass
(
'
select-all-option
'
);
$
(
'
label
'
,
$li
).
append
(
"
"
+
label
);
$
(
'
ul
'
,
this
.
$container
).
append
(
$li
);
$
(
'
#dropdown-container
ul
'
,
this
.
$container
).
append
(
$li
);
if
(
$
(
element
).
is
(
'
:disabled
'
))
{
$checkbox
.
attr
(
'
disabled
'
,
'
disabled
'
).
prop
(
'
disabled
'
,
true
).
parents
(
'
li
'
).
addClass
(
'
disabled
'
);
...
...
@@ -189,7 +189,7 @@
// Add a header for the group.
var
$li
=
$
(
'
<li><label style="margin:0;padding:3px 20px 3px 20px;height:100%;" class="multiselect-group"></label></li>
'
);
$
(
'
label
'
,
$li
).
text
(
groupName
);
$
(
'
ul
'
,
this
.
$container
).
append
(
$li
);
$
(
'
#dropdown-container
ul
'
,
this
.
$container
).
append
(
$li
);
// Add the options of the group.
$
(
'
option
'
,
group
).
each
(
$
.
proxy
(
function
(
index
,
element
)
{
...
...
@@ -205,7 +205,7 @@
},
this
));
// Bind the change event on the dropdown elements.
$
(
'
ul li input
'
,
this
.
$container
).
on
(
'
change
'
,
$
.
proxy
(
function
(
event
)
{
$
(
'
#dropdown-container ul li input
'
,
this
.
$container
).
on
(
'
change
'
,
$
.
proxy
(
function
(
event
)
{
var
checked
=
$
(
event
.
target
).
prop
(
'
checked
'
)
||
false
;
var
isSelectAllOption
=
$
(
event
.
target
).
val
()
==
'
select-all-option
'
;
...
...
@@ -263,7 +263,7 @@
this
.
$select
.
change
();
},
this
));
$
(
'
ul li a
'
,
this
.
$container
).
on
(
'
touchstart click
'
,
function
(
event
)
{
$
(
'
#dropdown-container ul li a
'
,
this
.
$container
).
on
(
'
touchstart click
'
,
function
(
event
)
{
event
.
stopPropagation
();
});
...
...
@@ -327,7 +327,7 @@
// Refreshs the checked options based on the current state of the select.
refresh
:
function
()
{
$
(
'
option
'
,
this
.
$select
).
each
(
$
.
proxy
(
function
(
index
,
element
)
{
var
$input
=
$
(
'
ul li input
'
,
this
.
$container
).
filter
(
function
()
{
var
$input
=
$
(
'
#dropdown-container
ul li input
'
,
this
.
$container
).
filter
(
function
()
{
return
$
(
this
).
val
()
==
$
(
element
).
val
();
});
...
...
@@ -353,7 +353,7 @@
// Select an option by its value.
select
:
function
(
value
)
{
var
$option
=
$
(
'
option
'
,
this
.
$select
).
filter
(
function
()
{
return
$
(
this
).
val
()
==
value
;
});
var
$checkbox
=
$
(
'
ul li input
'
,
this
.
$container
).
filter
(
function
()
{
return
$
(
this
).
val
()
==
value
;
});
var
$checkbox
=
$
(
'
#dropdown-container
ul li input
'
,
this
.
$container
).
filter
(
function
()
{
return
$
(
this
).
val
()
==
value
;
});
if
(
this
.
options
.
selectedClass
)
{
$checkbox
.
parents
(
'
li
'
).
addClass
(
this
.
options
.
selectedClass
);
...
...
@@ -369,7 +369,7 @@
// Deselect an option by its value.
deselect
:
function
(
value
)
{
var
$option
=
$
(
'
option
'
,
this
.
$select
).
filter
(
function
()
{
return
$
(
this
).
val
()
==
value
;
});
var
$checkbox
=
$
(
'
ul li input
'
,
this
.
$container
).
filter
(
function
()
{
return
$
(
this
).
val
()
==
value
;
});
var
$checkbox
=
$
(
'
#dropdown-container
ul li input
'
,
this
.
$container
).
filter
(
function
()
{
return
$
(
this
).
val
()
==
value
;
});
if
(
this
.
options
.
selectedClass
)
{
$checkbox
.
parents
(
'
li
'
).
removeClass
(
this
.
options
.
selectedClass
);
...
...
@@ -384,7 +384,7 @@
// Rebuild the whole dropdown menu.
rebuild
:
function
()
{
$
(
'
ul
'
,
this
.
$container
).
html
(
''
);
$
(
'
#dropdown-container
ul
'
,
this
.
$container
).
html
(
''
);
this
.
buildDropdown
(
this
.
$select
,
this
.
options
);
this
.
updateButtonText
();
},
...
...
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