Created
September 27, 2018 23:14
-
-
Save gjonespf/c01fe0b6b66a31c95f6cacccb59d8b39 to your computer and use it in GitHub Desktop.
ReportingServicesWebKitFix
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
| // RS relies on some buggy IE functionality - that overflow should be visible by default (which is not standard) | |
| // So Webkit based browsers don't show the report correctly as they hide overflow by default | |
| // We need to set overflow visible for the report div | |
| var deadman=60; | |
| function makeReportVisible() { | |
| if (typeof($) !== "undefined") { | |
| var div = $('table[id*=_fixedTable] > tbody > tr:last > td:last > div') | |
| if(div) { | |
| div.css('overflow', 'visible'); | |
| } | |
| } | |
| } | |
| // If jQuery is loaded, hook that up | |
| if (typeof($) !== "undefined") { | |
| $( document ).ready(function() { | |
| makeReportVisible(); | |
| }); | |
| } | |
| // Try to hook into our pageload sans any frameworks | |
| if(window.attachEvent) { | |
| window.attachEvent('onload', hookTryWireUp); | |
| } else { | |
| if(window.onload) { | |
| var curronload = window.onload; | |
| var newonload = function(evt) { | |
| curronload(evt); | |
| hookTryWireUp(evt); | |
| }; | |
| window.onload = newonload; | |
| } else { | |
| window.onload = hookTryWireUp; | |
| } | |
| } | |
| document.addEventListener("DOMContentLoaded", function(){ | |
| hookTryWireUp(); | |
| }); | |
| // Try to hook up our fix, once jQuery is loaded | |
| function hookTryWireUp() { | |
| if (typeof(Sys) !== "undefined") { | |
| hookPRM(); | |
| return; | |
| } | |
| if (typeof($) !== "undefined") { | |
| makeReportVisible(); | |
| return; | |
| } | |
| // Page could be still loading or having errors, try using a timer as a fallback | |
| if(deadman > 0) { | |
| deadman--; | |
| setTimeout( function(){ hookTryWireUp(); }, 1000); | |
| } | |
| } | |
| // Add into the PRM load sequence, if available | |
| function hookPRM() { | |
| if (typeof(Sys) !== "undefined") { | |
| var prm = Sys.WebForms.PageRequestManager.getInstance(); | |
| if (prm) | |
| { | |
| prm.add_pageLoaded( | |
| function (sender, args) { | |
| makeReportVisible(); | |
| }); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment