From 52f1f59583c384da73ab84a4f67fe6b4e48b7354 Mon Sep 17 00:00:00 2001 From: Priyanka Bhagwat Date: Wed, 27 Aug 2014 11:36:09 +0530 Subject: added clear button to search --- js/textbook_companion.js | 13 ++++++++++++- textbook_companion.module | 6 ++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/js/textbook_companion.js b/js/textbook_companion.js index 660ccdf..070e960 100755 --- a/js/textbook_companion.js +++ b/js/textbook_companion.js @@ -1,5 +1,5 @@ $( document ).ready(function() { - +//to search $('#searchtext').keyup(function(event) { var search_text = $('#searchtext').val(); var rg = new RegExp(search_text,'i'); @@ -20,6 +20,17 @@ $( document ).ready(function() { } }); }); + + //to clear the searched text + $('#search_clear').click(function() { + $('#searchtext').val(''); + $('#aicte-list-wrapper .title , .form-item' ).each(function(){ + $(this).parent().css('display', ''); + $(this).css('display', ''); + $(this).next().css('display', ''); + $(this).next().next().css('display', ''); + }); +}); $('#edit-same-address').click(function() { diff --git a/textbook_companion.module b/textbook_companion.module index 1a7c96c..ca73636 100755 --- a/textbook_companion.module +++ b/textbook_companion.module @@ -697,7 +697,8 @@ function textbook_companion_aicte_proposal_all() { $page_content .= "