Bug 29407: Make the pickup locations dropdown JS reusable
[koha.git] / koha-tmpl / intranet-tmpl / prog / js / item_search_fields.js
1 /* global __ */
2 $(document).ready(function(){
3     $("#add_field_form").hide();
4     $("#new_search_field").on("click",function(e){
5         e.preventDefault();
6         $("#add_field_form").show();
7         $(".dialog").hide();
8         $("#search_fields_list,#toolbar").hide();
9     });
10     $(".cancel").on("click",function(e){
11         e.preventDefault();
12         $("#add_field_form").hide();
13         $(".dialog").show();
14         $("#search_fields_list,#toolbar").show();
15     });
16     $(".field-delete").on("click",function(){
17         $(this).parent().parent().addClass("highlighted-row");
18         if (confirm( __("Are you sure you want to delete this field?") )) {
19             return true;
20         } else {
21             $(this).parent().parent().removeClass("highlighted-row");
22             return false;
23         }
24     });
25 });