Skip to content

Commit

Permalink
Merge pull request #62 from creative-commoners/pulls/3.2/remove-searc…
Browse files Browse the repository at this point in the history
…h-default

FIX Remove search field value related logic, a placeholder is used instead now
  • Loading branch information
robbieaverill authored Nov 26, 2018
2 parents 5a6b34c + b32fe38 commit 179fe14
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions javascript/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@ jQuery.noConflict();

(function($) {
$(document).ready(function() {
/* removes text from search form on focus and replaces it on unfocus - if text is entered then it does not get replaced with default on unfocus */
// L is a magnifying glass icon in the font
$('#SearchForm_SearchForm_action_results').val('L');
var searchField = $('#SearchForm_SearchForm_Search');
var default_value = searchField.val();
searchField.focus(function() {
$(this).addClass('active');
if(searchField.val() == default_value) {
searchField.val('');
}
});
searchField.blur(function() {
if(searchField.val() == '') {
searchField.val(default_value);
}
});

if (!$.browser.msie || ($.browser.msie && (parseInt($.browser.version, 10) > 8))) {
var searchBarButton = $("span.search-dropdown-icon");
Expand Down

0 comments on commit 179fe14

Please sign in to comment.