Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
23866f67
Commit
23866f67
authored
Apr 26, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved usability for the apidoc search
parent
003bdf6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
style.css
extensions/apidoc/templates/bootstrap/assets/css/style.css
+6
-2
main.php
extensions/apidoc/templates/bootstrap/layouts/main.php
+15
-8
No files found.
extensions/apidoc/templates/bootstrap/assets/css/style.css
View file @
23866f67
...
...
@@ -119,8 +119,12 @@ table.summary-table .col-defined { width: 15%; }
top
:
50px
;
z-index
:
1000
;
background
:
#fff
;
border
:
solid
1px
#000
;
border-radius
:
0
;
/* reset all due to android browser issues http://caniuse.com/#search=border-radius */
border-top-left-radius
:
0
;
border-top-right-radius
:
0
;
border-bottom-left-radius
:
0
;
border-bottom-right-radius
:
0
;
}
#search-results
{
...
...
extensions/apidoc/templates/bootstrap/layouts/main.php
View file @
23866f67
...
...
@@ -83,15 +83,13 @@ $this->beginPage();
$this
->
registerJsFile
(
'./jssearch.index.js'
,
'yii\apidoc\templates\bootstrap\assets\JsSearchAsset'
);
$this
->
registerJs
(
<<<JS
$('#searchbox').focus(
);
var searchBox = $('#searchbox'
);
$(document).on("keyup", function(event) {
if (event.which == 27) {
$('#search-resultbox').hide();
}
});
// focus the search field
searchBox.focus();
$('#searchbox').on("keyup", function(event) {
// search when typing in search field
searchBox.on("keyup", function(event) {
var query = $(this).val();
if (query == '' || event.which == 27) {
...
...
@@ -151,13 +149,22 @@ $('#searchbox').on("keyup", function(event) {
$('#search-results').html(resHtml);
}
});
// hide the search results on ESC
$(document).on("keyup", function(event) { if (event.which == 27) { $('#search-resultbox').hide(); } });
// hide search results on click to document
$(document).bind('click', function (e) { $('#search-resultbox').hide(); });
// except the following:
searchBox.bind('click', function(e) { e.stopPropagation(); });
$('#search-resultbox').bind('click', function(e) { e.stopPropagation(); });
JS
);
NavBar
::
end
();
?>
<div
id=
"search-resultbox"
style=
"display: none;"
>
<div
id=
"search-resultbox"
style=
"display: none;"
class=
"modal-content"
>
<ul
id=
"search-results"
>
</ul>
</div>
...
...
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