{:uriI"Áfile:///root/projects/rails_db/app/assets/javascripts/rails_db/show_hide_columns.js?type=application/javascript&pipeline=self&id=b7803e92252b7bbfbdaa4a6df8d5fd173375473005a9bbc88333cb44f3fa51c9:ET:load_pathI"3/root/projects/rails_db/app/assets/javascripts;T: filenameI"Q/root/projects/rails_db/app/assets/javascripts/rails_db/show_hide_columns.js;T: nameI"rails_db/show_hide_columns;T:logical_pathI"'rails_db/show_hide_columns.self.js;T:content_typeI"application/javascript;T: sourceI"$(function(){ $('body').on('click', '.settings-link', function() { $('.rails-db-settings').toggle(); return false; }); $('body').on('click', '.column-name input', function() { table_name = 'Table: ' + $('a[table_name]').attr('table_name'); column_name = $(this).prop('name'); if($(this).prop('checked') == false) { write_column_to_cookie(table_name, column_name); } else { remove_column_from_cookie(table_name, column_name); } switch_column_visibility(column_name); toggle_columns(); }); }); function write_column_to_cookie(table_name, column_name) { column_names = get_column_names_from_cookie(table_name); $.cookie(table_name, column_names += ',' + column_name); }; function remove_column_from_cookie(table_name, column_name) { column_names = get_column_names_from_cookie(table_name); $.cookie(table_name, column_names.replace(',' + column_name, '')); }; function get_column_names_from_cookie(table_name) { cookie = $.cookie(table_name); if(cookie == undefined) { return ''; } else { return cookie; } }; function switch_column_visibility(column_name) { $('th.column_' + column_name).toggle(); $('td.column_' + column_name).toggle(); }; function toggle_columns() { if($('.column-name input:checked').length == 0) { $('.column-name input[type=checkbox]').each(function() { column_name = $(this).prop('name'); $(this).prop("checked", true); remove_column_from_cookie(table_name, column_name); switch_column_visibility(column_name); }); } }; ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"_file-digest:///root/projects/rails_db/app/assets/javascripts/rails_db/show_hide_columns.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%íóoüËRr§AäÊu‘dS ?«öµVZðuàŒÂ<: lengthi:dependencies_digest"%Æ‘GÉ*¯R³Gu+‘ÌEþãb«ãÒI¿y› fÅiŒ:idI"Eb7803e92252b7bbfbdaa4a6df8d5fd173375473005a9bbc88333cb44f3fa51c9;F: mtimel+½Þ-Y