{:uriI"Èfile:///Users/admin/projects/rails_db/app/assets/javascripts/rails_db/show_hide_columns.js?type=application/javascript&pipeline=self&id=795823d58073075589e884ae932c4f293164e39dc122c75adc11830815f269db:ET:load_pathI":/Users/admin/projects/rails_db/app/assets/javascripts;T: filenameI"X/Users/admin/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"ffile-digest:///Users/admin/projects/rails_db/app/assets/javascripts/rails_db/show_hide_columns.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: to_loado;;}F: to_linko;;}F:map{ I" version;TiI" file;TI""rails_db/show_hide_columns.js;TI" mappings;TI" AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;TI" sources;T[I" show_hide_columns.source.js;TI" names;T[I"x_sprockets_linecount;Ti;: charsetI" utf-8;F: digest"%íóoüËRr§AäÊu‘dS ?«öµVZðuàŒÂ<: lengthi:environment_versionI"1.0;T:dependencies_digest"%'™© ËõóÑUg‡a{üœ£ê´§…7C²d:idI"E795823d58073075589e884ae932c4f293164e39dc122c75adc11830815f269db;F