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
21225a84
Commit
21225a84
authored
Nov 01, 2014
by
David Stutz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #406 from KyleNeedham/fix-405
Fixes #405
parents
4da7b531
902b7216
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
6 deletions
+39
-6
bootstrap-multiselect.js
dist/js/bootstrap-multiselect.js
+7
-0
index.html
index.html
+0
-5
bootstrap-multiselect.js
tests/spec/bootstrap-multiselect.js
+32
-1
No files found.
dist/js/bootstrap-multiselect.js
View file @
21225a84
...
...
@@ -456,6 +456,13 @@
var
$target
=
$
(
event
.
target
);
if
(
document
.
getSelection
().
type
===
'
Range
'
)
{
var
$input
=
$
(
this
).
find
(
"
input:first
"
);
$input
.
prop
(
"
checked
"
,
!
$input
.
prop
(
"
checked
"
))
.
trigger
(
"
change
"
);
}
if
(
event
.
shiftKey
)
{
var
checked
=
$target
.
prop
(
'
checked
'
)
||
false
;
...
...
index.html
View file @
21225a84
...
...
@@ -3880,11 +3880,6 @@ $('.multiselect').multiselect({
<dd>
See issue
<a
href=
"https://github.com/davidstutz/bootstrap-multiselect/issues/396"
></a>
. Pull requests are welcome.
</dd>
<dt>
Unable to select an option while text is selected.
</dt>
<dd>
As reported in
<a
href=
"https://github.com/davidstutz/bootstrap-multiselect/issues/405"
>
#405
</a>
this seems to be restricted to several Chrome builds.
</dd>
</dl>
<div
class=
"page-header"
>
...
...
tests/spec/bootstrap-multiselect.js
View file @
21225a84
...
...
@@ -573,4 +573,35 @@ describe('Bootstrap Multiselect Specific Issues', function() {
$
(
'
#multiselect
'
).
multiselect
(
'
destroy
'
);
$
(
'
#multiselect
'
).
remove
();
});
});
\ No newline at end of file
it
(
'
#405
'
,
function
()
{
var
selection
=
document
.
getSelection
();
var
range
=
document
.
createRange
();
var
$selection
=
$
(
'
<span>Some text to select</span>
'
);
var
$select
=
$
(
'
<select id="multiselect" multiple="multiple"></select>
'
);
for
(
var
i
=
1
;
i
<
5
;
i
++
)
{
$select
.
append
(
'
<option value="
'
+
i
+
'
">select option</option>
'
);
}
$
(
'
body
'
).
append
(
$selection
).
append
(
$select
);
$select
.
multiselect
({
buttonContainer
:
'
<div id="multiselect-container"></div>
'
,
});
range
.
selectNodeContents
(
$selection
.
get
(
0
));
selection
.
removeAllRanges
();
selection
.
addRange
(
range
);
if
(
document
.
getSelection
().
type
===
'
Range
'
)
{
$
(
'
#multiselect-container
'
).
find
(
'
a:first
'
).
trigger
(
'
click
'
);
expect
(
$
(
'
#multiselect-container
'
).
find
(
'
input:first
'
).
prop
(
'
checked
'
)).
toBe
(
true
);
}
$
(
'
#multiselect
'
).
multiselect
(
'
destroy
'
);
$
(
'
#multiselect
'
).
remove
();
$selection
.
remove
();
});
});
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