Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
server
team-presentation
Commits
a781b6a2
Commit
a781b6a2
authored
Jun 19, 2017
by
Hakim El Hattab
Browse files
clear existing matches when searching for empty string #1909
parent
7d0d3c24
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugin/search/search.js
View file @
a781b6a2
...
@@ -138,19 +138,27 @@ function Hilitor(id, tag)
...
@@ -138,19 +138,27 @@ function Hilitor(id, tag)
if
(
searchboxDirty
)
{
if
(
searchboxDirty
)
{
var
searchstring
=
document
.
getElementById
(
"
searchinput
"
).
value
;
var
searchstring
=
document
.
getElementById
(
"
searchinput
"
).
value
;
//find the keyword amongst the slides
if
(
searchstring
===
''
)
{
myHilitor
=
new
Hilitor
(
"
slidecontent
"
);
if
(
myHilitor
)
myHilitor
.
remove
();
matchedSlides
=
myHilitor
.
apply
(
searchstring
);
matchedSlides
=
null
;
currentMatchedIndex
=
0
;
}
else
{
//find the keyword amongst the slides
myHilitor
=
new
Hilitor
(
"
slidecontent
"
);
matchedSlides
=
myHilitor
.
apply
(
searchstring
);
currentMatchedIndex
=
0
;
}
}
}
//navigate to the next slide that has the keyword, wrapping to the first if necessary
if
(
matchedSlides
)
{
if
(
matchedSlides
.
length
&&
(
matchedSlides
.
length
<=
currentMatchedIndex
))
{
//navigate to the next slide that has the keyword, wrapping to the first if necessary
currentMatchedIndex
=
0
;
if
(
matchedSlides
.
length
&&
(
matchedSlides
.
length
<=
currentMatchedIndex
))
{
}
currentMatchedIndex
=
0
;
if
(
matchedSlides
.
length
>
currentMatchedIndex
)
{
}
Reveal
.
slide
(
matchedSlides
[
currentMatchedIndex
].
h
,
matchedSlides
[
currentMatchedIndex
].
v
);
if
(
matchedSlides
.
length
>
currentMatchedIndex
)
{
currentMatchedIndex
++
;
Reveal
.
slide
(
matchedSlides
[
currentMatchedIndex
].
h
,
matchedSlides
[
currentMatchedIndex
].
v
);
currentMatchedIndex
++
;
}
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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