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
e5f768c1
Commit
e5f768c1
authored
Oct 16, 2015
by
David Stutz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/davidstutz/bootstrap-multiselect
parents
74c0fdaa
562ce09e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
bootstrap-multiselect.js
dist/js/bootstrap-multiselect.js
+38
-1
No files found.
dist/js/bootstrap-multiselect.js
View file @
e5f768c1
...
...
@@ -46,7 +46,7 @@
if
(
typeof
ko
!==
'
undefined
'
&&
ko
.
bindingHandlers
&&
!
ko
.
bindingHandlers
.
multiselect
)
{
ko
.
bindingHandlers
.
multiselect
=
{
after
:
[
'
options
'
,
'
value
'
,
'
selectedOptions
'
],
after
:
[
'
options
'
,
'
value
'
,
'
selectedOptions
'
,
'
enable
'
,
'
disable
'
],
init
:
function
(
element
,
valueAccessor
,
allBindings
,
viewModel
,
bindingContext
)
{
var
$element
=
$
(
element
);
...
...
@@ -107,6 +107,43 @@
}
}
var
setEnabled
=
function
(
enable
)
{
setTimeout
(
function
()
{
if
(
enable
)
$element
.
multiselect
(
'
enable
'
);
else
$element
.
multiselect
(
'
disable
'
);
});
};
if
(
allBindings
.
has
(
'
enable
'
))
{
var
enable
=
allBindings
.
get
(
'
enable
'
);
if
(
ko
.
isObservable
(
enable
))
{
ko
.
computed
({
read
:
function
()
{
setEnabled
(
enable
());
},
disposeWhenNodeIsRemoved
:
element
}).
extend
({
rateLimit
:
100
,
notifyWhenChangesStop
:
true
});
}
else
{
setEnabled
(
enable
);
}
}
if
(
allBindings
.
has
(
'
disable
'
))
{
var
disable
=
allBindings
.
get
(
'
disable
'
);
if
(
ko
.
isObservable
(
disable
))
{
ko
.
computed
({
read
:
function
()
{
setEnabled
(
!
disable
());
},
disposeWhenNodeIsRemoved
:
element
}).
extend
({
rateLimit
:
100
,
notifyWhenChangesStop
:
true
});
}
else
{
setEnabled
(
!
disable
);
}
}
ko
.
utils
.
domNodeDisposal
.
addDisposeCallback
(
element
,
function
()
{
$element
.
multiselect
(
'
destroy
'
);
});
...
...
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