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
1e3f4abb
Commit
1e3f4abb
authored
Apr 25, 2013
by
Luís Rudge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trying some async stuff
parent
32549864
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
505 deletions
+13
-505
index.html
index.html
+0
-500
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+13
-5
No files found.
index.html
View file @
1e3f4abb
This diff is collapsed.
Click to expand it.
js/bootstrap-multiselect.js
View file @
1e3f4abb
...
@@ -57,7 +57,13 @@
...
@@ -57,7 +57,13 @@
});
});
};
};
this
.
query
=
''
;
this
.
query
=
''
;
this
.
searchTimeout
=
null
;
this
.
searchTimeout
=
null
;
this
.
asyncFunction
=
function
(
callback
,
timeout
,
self
)
{
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
,
3
);
return
setTimeout
(
function
()
{
callback
.
apply
(
self
||
window
,
args
);
},
timeout
);
};
this
.
options
.
multiple
=
this
.
$select
.
attr
(
'
multiple
'
)
==
"
multiple
"
;
this
.
options
.
multiple
=
this
.
$select
.
attr
(
'
multiple
'
)
==
"
multiple
"
;
...
@@ -72,21 +78,23 @@
...
@@ -72,21 +78,23 @@
}).
keydown
(
$
.
proxy
(
function
(
event
)
{
}).
keydown
(
$
.
proxy
(
function
(
event
)
{
// This is useful to catch "keydown" events after the browser has updated the control
// This is useful to catch "keydown" events after the browser has updated the control
clearTimeout
(
this
.
searchTimeout
);
clearTimeout
(
this
.
searchTimeout
);
this
.
searchTimeout
=
setTimeout
(
$
.
proxy
(
function
()
{
this
.
searchTimeout
=
this
.
asyncFunction
(
$
.
proxy
(
function
()
{
var
inputValue
=
event
.
target
.
value
;
var
inputValue
=
event
.
target
.
value
;
if
(
inputValue
!=
this
.
query
)
{
if
(
inputValue
!=
this
.
query
)
{
this
.
query
=
inputValue
;
this
.
query
=
inputValue
;
this
.
$select
.
empty
();
this
.
$select
.
empty
();
var
filteredValues
=
this
.
getFilteredOptions
();
var
filteredValues
=
this
.
getFilteredOptions
();
var
newOptions
=
''
;
for
(
var
i
=
0
;
i
<
filteredValues
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
filteredValues
.
length
;
i
++
)
{
var
option
=
filteredValues
[
i
];
var
option
=
filteredValues
[
i
];
this
.
$select
.
append
(
$
(
'
<option></option>
'
).
attr
(
'
value
'
,
option
.
value
).
text
(
option
.
text
))
;
newOptions
+=
'
<option value="
'
+
option
.
value
+
'
">
'
+
option
.
text
+
'
</option>
'
;
}
}
console
.
log
(
newOptions
);
this
.
$select
.
html
(
newOptions
);
this
.
rebuild
();
this
.
rebuild
();
}
}
},
this
),
300
);
},
this
),
300
,
this
);
},
this
));
},
this
));
}
}
...
...
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