-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an 'X' button for clearing text in the search field. #62
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,13 @@ $(document).ready(function(){ | |
if (visible.photo()) photo.setTitle(photo.getID()); | ||
else album.setTitle(album.getID()); | ||
}) | ||
|
||
/* Clear Search */ | ||
.on(event_name, "#clearSearch", function (e) { | ||
e.preventDefault(); | ||
$("#search").val(""); | ||
$("#search").focus(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After Clear Search button is clicked and the search field reset, focus is given back to the search box so that users don't have to re-select it. |
||
}) | ||
|
||
/* Navigation */ | ||
.on("click", ".album", function() { lychee.goto($(this).attr("data-id")) }) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
<!-- CSS --> | ||
<link type="text/css" rel="stylesheet" href="assets/css/min/reset.css"> | ||
|
||
<!-- Development | ||
<!-- Development --> | ||
<link type="text/css" rel="stylesheet" href="assets/css/modules/upload.css"> | ||
<link type="text/css" rel="stylesheet" href="assets/css/modules/tooltip.css"> | ||
<link type="text/css" rel="stylesheet" href="assets/css/modules/misc.css"> | ||
|
@@ -25,10 +25,10 @@ | |
<link type="text/css" rel="stylesheet" href="assets/css/modules/font.css"> | ||
<link type="text/css" rel="stylesheet" href="assets/css/modules/contextmenu.css"> | ||
<link type="text/css" rel="stylesheet" href="assets/css/modules/content.css"> | ||
<link type="text/css" rel="stylesheet" href="assets/css/modules/animations.css"> --> | ||
<link type="text/css" rel="stylesheet" href="assets/css/modules/animations.css"> | ||
|
||
<!-- Production --> | ||
<link type="text/css" rel="stylesheet" href="assets/css/min/main.css"> | ||
<!-- Production | ||
<link type="text/css" rel="stylesheet" href="assets/css/min/main.css">--> | ||
|
||
<link rel="shortcut icon" href="assets/img/favicon.ico"> | ||
<link rel="apple-touch-icon" href="assets/img/apple-touch-icon-iphone.png" sizes="120x120"> | ||
|
@@ -55,6 +55,7 @@ | |
<a class="button right icon icon-plus button_add"></a> | ||
<a class="button_divider"></a> | ||
<input id="search" type="text" name="search" placeholder="Search …"> | ||
<a id="clearSearch" class="button right" href="#">×</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the Clear Search button added to the HTML. |
||
</div> | ||
<div id="tools_album"> | ||
<a class="button left icon-arrow-left" id="button_back_home"></a> | ||
|
@@ -98,7 +99,7 @@ | |
<!-- JS --> | ||
<script defer type="text/javascript" src="assets/js/min/frameworks.js"></script> | ||
|
||
<!-- Development | ||
<!-- Development --> | ||
<script defer type="text/javascript" src="assets/js/modules/init.js"></script> | ||
<script defer type="text/javascript" src="assets/js/modules/lychee.js"></script> | ||
<script defer type="text/javascript" src="assets/js/modules/build.js"></script> | ||
|
@@ -113,10 +114,10 @@ | |
<script defer type="text/javascript" src="assets/js/modules/visible.js"></script> | ||
<script defer type="text/javascript" src="assets/js/modules/loadingBar.js"></script> | ||
<script defer type="text/javascript" src="assets/js/modules/contextMenu.js"></script> | ||
<script defer type="text/javascript" src="assets/js/modules/search.js"></script> --> | ||
<script defer type="text/javascript" src="assets/js/modules/search.js"></script> | ||
|
||
<!-- Production --> | ||
<script defer type="text/javascript" src="assets/js/min/main.js"></script> | ||
<!-- Production | ||
<script defer type="text/javascript" src="assets/js/min/main.js"></script> --> | ||
|
||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSS Code for the "X" or Clear Search button.
It had to be position: absolute due to the resizing of the search box.