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
c23484dd
Commit
c23484dd
authored
Oct 14, 2015
by
David Stutz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #600 from Kichikahunov/master
Added new event. Trigger when initialized. Fixing #543.
parents
ccf0758b
0de81032
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
bower.json
bower.json
+1
-1
bootstrap-multiselect.js
dist/js/bootstrap-multiselect.js
+13
-1
SpecRunner.html
tests/SpecRunner.html
+1
-1
bootstrap-multiselect.js
tests/spec/bootstrap-multiselect.js
+11
-2
No files found.
bower.json
View file @
c23484dd
...
...
@@ -2,7 +2,7 @@
"name"
:
"bootstrap-multiselect"
,
"description"
:
"Twitter Bootstrap plugin to make selects user friendly."
,
"homepage"
:
"http://davidstutz.github.io/bootstrap-multiselect/"
,
"version"
:
"0.9.1
3
"
,
"version"
:
"0.9.1
4
"
,
"keywords"
:
[
"js"
,
"css"
,
...
...
dist/js/bootstrap-multiselect.js
View file @
c23484dd
...
...
@@ -151,7 +151,7 @@
this
.
originalOptions
=
this
.
$select
.
clone
()[
0
].
options
;
this
.
query
=
''
;
this
.
searchTimeout
=
null
;
this
.
lastToggledInput
=
null
this
.
lastToggledInput
=
null
;
this
.
options
.
multiple
=
this
.
$select
.
attr
(
'
multiple
'
)
===
"
multiple
"
;
this
.
options
.
onChange
=
$
.
proxy
(
this
.
options
.
onChange
,
this
);
...
...
@@ -159,6 +159,7 @@
this
.
options
.
onDropdownHide
=
$
.
proxy
(
this
.
options
.
onDropdownHide
,
this
);
this
.
options
.
onDropdownShown
=
$
.
proxy
(
this
.
options
.
onDropdownShown
,
this
);
this
.
options
.
onDropdownHidden
=
$
.
proxy
(
this
.
options
.
onDropdownHidden
,
this
);
this
.
options
.
onInitialized
=
$
.
proxy
(
this
.
options
.
onInitialized
,
this
);
// Build select all if enabled.
this
.
buildContainer
();
...
...
@@ -176,6 +177,8 @@
}
this
.
$select
.
hide
().
after
(
this
.
$container
);
this
.
options
.
onInitialized
(
this
.
$select
,
this
.
$container
);
};
Multiselect
.
prototype
=
{
...
...
@@ -309,6 +312,15 @@
*/
onSelectAll
:
function
()
{
},
/**
* Triggered after initializing.
*
* @param {jQuery} $select
* @param {jQuery} $container
*/
onInitialized
:
function
(
$select
,
$container
)
{
},
enableHTML
:
false
,
buttonClass
:
'
btn btn-default
'
,
...
...
tests/SpecRunner.html
View file @
c23484dd
...
...
@@ -13,7 +13,7 @@
<script
type=
"text/javascript"
src=
"lib/jasmine-2.0.2/boot.js"
></script>
<script
type=
"text/javascript"
src=
"../docs/js/jquery-2.1.3.min.js"
></script>
<script
type=
"text/javascript"
src=
"../docs/js/bootstrap-3.
2.0
.min.js"
></script>
<script
type=
"text/javascript"
src=
"../docs/js/bootstrap-3.
3.2
.min.js"
></script>
<script
type=
"text/javascript"
src=
"../dist/js/bootstrap-multiselect.js"
></script>
<script
type=
"text/javascript"
src=
"spec/bootstrap-multiselect.js"
></script>
...
...
tests/spec/bootstrap-multiselect.js
View file @
c23484dd
describe
(
'
Bootstrap Multiselect "Core".
'
,
function
()
{
var
onInitialized
=
false
;
beforeEach
(
function
()
{
var
$select
=
$
(
'
<select id="multiselect" multiple="multiple"></select>
'
);
...
...
@@ -15,7 +17,10 @@ describe('Bootstrap Multiselect "Core".', function() {
$
(
'
body
'
).
append
(
$select
);
$select
.
multiselect
({
buttonContainer
:
'
<div id="multiselect-container"></div>
'
buttonContainer
:
'
<div id="multiselect-container"></div>
'
,
onInitialized
:
function
(
$select
)
{
onInitialized
=
true
;
}
});
});
...
...
@@ -197,7 +202,11 @@ describe('Bootstrap Multiselect "Core".', function() {
expect
(
$
(
'
#multiselect-container input[value="10"]
'
).
prop
(
'
checked
'
)).
toBe
(
false
);
expect
(
$
(
'
#multiselect option[value="10"]
'
).
prop
(
'
selected
'
)).
toBe
(
false
);
});
it
(
'
Should trigger onInitialized.
'
,
function
()
{
expect
(
onInitialized
).
toBe
(
true
);
});
afterEach
(
function
()
{
$
(
'
#multiselect
'
).
multiselect
(
'
destroy
'
);
$
(
'
#multiselect
'
).
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