1bez.ctl.tasks = function() { 2 //bez_show_desc 3 jQuery(".bez_desc_row").hide(); 4 jQuery("#bez_show_desc").on('click', function(e) { 5 if (jQuery(this).find(".show").is(":visible")) { 6 jQuery(".bez_desc_row").show(); 7 jQuery(this).find(".hide").show(); 8 jQuery(this).find(".show").hide(); 9 } else { 10 jQuery(".bez_desc_row").hide(); 11 jQuery(this).find(".hide").hide(); 12 jQuery(this).find(".show").show(); 13 } 14 e.preventDefault(); 15 }); 16 17 jQuery(".bez_show_single_desc").on('click', function(e) { 18 var $row = jQuery(this).parents('tr'), 19 row_id = $row.data('bez-row-id'), 20 $desc_rows = $row.parents('table').find('.task'+row_id); 21 22 if ($desc_rows.is(":visible")) { 23 $desc_rows.hide(); 24 } else { 25 $desc_rows.show(); 26 } 27 e.preventDefault(); 28 }); 29 30 //highlight filters 31 var highlight = function() { 32 var $this = jQuery(this); 33 if ($this.find('option:selected').index() !== 0) { 34 $this.css('outline', '2px solid #FB5A5A'); 35 } else { 36 $this.css('outline', 'none'); 37 } 38 }; 39 var highlight_input = function() { 40 var $this = jQuery(this); 41 if ($this.val().length > 0) { 42 $this.css('outline', '2px solid #FB5A5A'); 43 } else { 44 $this.css('outline', 'none'); 45 } 46 }; 47 jQuery(".bez_filter_form select").change(highlight).each(highlight); 48 jQuery(".bez_filter_form input:text").blur(highlight_input).each(highlight_input); 49 50 jQuery(".plugin__bez_bulk_checkbox").on('change', function(e) { 51 if (jQuery(".plugin__bez_bulk_checkbox:checked").length > 0) { 52 jQuery("#plugin__bez_bulk_actions_box").show(); 53 } else { 54 jQuery("#plugin__bez_bulk_actions_box").hide(); 55 } 56 }); 57 58 jQuery('#plugin__bez_bulk_actions_box button[value=bulk_delete]').click('on', function (event) { 59 if (!window.confirm(LANG.plugins.bez.bulk_delete_confirm)) { 60 event.preventDefault(); 61 } 62 }); 63 64 jQuery('#plugin__bez_bulk_actions_box button[value=bulk_move]').click('on', function (event) { 65 if (!window.confirm(LANG.plugins.bez.bulk_move_confirm)) { 66 event.preventDefault(); 67 } 68 }); 69};