Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
19dc44df
Commit
19dc44df
authored
Oct 12, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent selection of first item in typeahead list
parent
c6b15039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/vendor/bootstrap/bootstrap.js
+12
-4
No files found.
src/vendor/bootstrap/bootstrap.js
View file @
19dc44df
...
@@ -1906,7 +1906,8 @@
...
@@ -1906,7 +1906,8 @@
constructor
:
Typeahead
constructor
:
Typeahead
,
select
:
function
()
{
,
select
:
function
()
{
var
val
=
this
.
$menu
.
find
(
'.active'
).
attr
(
'data-value'
)
// CHANGE (rashidkpc) If nothing is selected, use existing value
var
val
=
this
.
$menu
.
find
(
'.active'
).
attr
(
'data-value'
)
||
this
.
$element
.
val
();
this
.
$element
this
.
$element
.
val
(
this
.
updater
(
val
))
.
val
(
this
.
updater
(
val
))
.
change
()
.
change
()
...
@@ -2005,7 +2006,8 @@
...
@@ -2005,7 +2006,8 @@
return
i
[
0
]
return
i
[
0
]
})
})
items
.
first
().
addClass
(
'active'
)
// CHANGE (rashidpc) Do not select first element by default
// items.first().addClass('active')
this
.
$menu
.
html
(
items
)
this
.
$menu
.
html
(
items
)
return
this
return
this
}
}
...
@@ -2116,8 +2118,14 @@
...
@@ -2116,8 +2118,14 @@
this
.
lookup
()
this
.
lookup
()
}
}
e
.
stopPropagation
()
if
(
e
.
keyCode
===
13
&&
typeof
this
.
$menu
.
find
(
'.active'
).
attr
(
'data-value'
)
===
'undefined'
)
{
e
.
preventDefault
()
// CHANGE (rashidkpc). Enter was hit, nothing was selected from typeahead, submit form
this
.
$element
.
submit
();
}
else
{
e
.
stopPropagation
()
e
.
preventDefault
()
}
}
}
,
focus
:
function
(
e
)
{
,
focus
:
function
(
e
)
{
...
...
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