Skip to content

Commit

Permalink
Clean filters button added to the search input. I also optimized load…
Browse files Browse the repository at this point in the history
…ing of the template files.
  • Loading branch information
dejande committed Nov 12, 2014
1 parent d184942 commit c687a00
Show file tree
Hide file tree
Showing 7 changed files with 380 additions and 318 deletions.
3 changes: 2 additions & 1 deletion Olog/public_html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ <h5>Filter Log Entries</h5>
<input id="search-order" type="checkbox"> Show newest first
</label>
<div class="input-append">
<input type="text" placeholder="Search ..." id="search-query" class="search_input">
<input autocomplete="off" type="text" placeholder="Search ..." id="search-query" class="search_input" />
<img alt="" id="search-query-clean" src="static/img/clean.png" />
<button id="search-button" type="button" class="btn">Search</button>
</div>
</div>
Expand Down
18 changes: 17 additions & 1 deletion Olog/public_html/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,23 @@ html, body {

.search_input {
display: inline-block;
width: 80%;
width: 70%;
padding-right: 40px !important;
}

#search-query-clean {
position:relative;
left: -30px;
top: 5px;
z-index: -1;
cursor: pointer;
width: 16px;
height: 16px;
}

#search-button {
position: relative;
left: -15px;
}

.form-search-box {
Expand Down
Binary file added Olog/public_html/static/img/clean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions Olog/public_html/static/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,17 @@ function enableCreatingAndModifying() {
function saveFilterData(dataToBeSaved) {
l("save filters data");
l(dataToBeSaved);
showHideSearchCleanButton($('#search-query'));
$.cookie(filtersCookieName, JSON.stringify(dataToBeSaved));
}

/**
* Delete filter cookie when user presses clean filters button
*/
function deleteFilterData() {
$.removeCookie(filtersCookieName);
}

/**
* Save settings data to a cookie
* @param {type} dataToBeSaved data to be saved into a cookie
Expand Down
Loading

0 comments on commit c687a00

Please sign in to comment.