Created
May 19, 2017 17:02
-
-
Save cheesepaulo/11a10222fc41a0a5d0dc1db2c1fa8769 to your computer and use it in GitHub Desktop.
Hide fields from print on rails admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Put this file on app/assets/javascripts/rais_admin/custom/ui.js | |
// Hide elements from print | |
window.onload = function() { | |
document.querySelector('div.well').className += ' hidden-print'; | |
document.querySelector('div.navbar-header').className += ' hidden-print'; | |
document.querySelector('ol.breadcrumb').className += ' hidden-print'; | |
document.querySelector('a.navbar-brand').className += ' hidden-print'; | |
document.querySelector('div.col-sm-3').className += ' hidden-print'; | |
document.querySelector('ul.nav-tabs').className += ' hidden-print'; | |
document.querySelector('a.pjax').className += ' hidden-print'; | |
document.querySelector('th.last').className += ' hidden-print'; | |
document.querySelector('th.shrink').className += ' hidden-print'; | |
$('table tbody tr td:last-child').addClass( 'hidden-print' ); | |
$('table tbody tr td:first-child').addClass( 'hidden-print' ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment