Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
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
Commits
70fecd11
Commit
70fecd11
authored
Jan 30, 2012
by
Pete Hopkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fires change event when element is selected from menu
parent
80d03e14
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
js/bootstrap-typeahead.js
js/bootstrap-typeahead.js
+1
-0
js/tests/unit/bootstrap-typeahead.js
js/tests/unit/bootstrap-typeahead.js
+5
-1
No files found.
js/bootstrap-typeahead.js
View file @
70fecd11
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
,
select
:
function
()
{
,
select
:
function
()
{
var
val
=
this
.
$menu
.
find
(
'
.active
'
).
attr
(
'
data-value
'
)
var
val
=
this
.
$menu
.
find
(
'
.active
'
).
attr
(
'
data-value
'
)
this
.
$element
.
val
(
val
)
this
.
$element
.
val
(
val
)
this
.
$element
.
change
();
return
this
.
hide
()
return
this
.
hide
()
}
}
...
...
js/tests/unit/bootstrap-typeahead.js
View file @
70fecd11
...
@@ -114,15 +114,19 @@ $(function () {
...
@@ -114,15 +114,19 @@ $(function () {
source
:
[
'
aa
'
,
'
ab
'
,
'
ac
'
]
source
:
[
'
aa
'
,
'
ab
'
,
'
ac
'
]
})
})
,
typeahead
=
$input
.
data
(
'
typeahead
'
)
,
typeahead
=
$input
.
data
(
'
typeahead
'
)
,
changed
=
false
$input
.
val
(
'
a
'
)
$input
.
val
(
'
a
'
)
typeahead
.
lookup
()
typeahead
.
lookup
()
$input
.
change
(
function
()
{
changed
=
true
});
$
(
typeahead
.
$menu
.
find
(
'
li
'
)[
2
]).
mouseover
().
click
()
$
(
typeahead
.
$menu
.
find
(
'
li
'
)[
2
]).
mouseover
().
click
()
equals
(
$input
.
val
(),
'
ac
'
,
'
input value was correctly set
'
)
equals
(
$input
.
val
(),
'
ac
'
,
'
input value was correctly set
'
)
ok
(
!
typeahead
.
$menu
.
is
(
'
:visible
'
),
'
the menu was hidden
'
)
ok
(
!
typeahead
.
$menu
.
is
(
'
:visible
'
),
'
the menu was hidden
'
)
ok
(
changed
,
'
a change event was fired
'
)
typeahead
.
$menu
.
remove
()
typeahead
.
$menu
.
remove
()
})
})
})
})
\ No newline at end of file
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