Skip to content

Instantly share code, notes, and snippets.

@mattmetten
Created August 12, 2015 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmetten/d739445f2a0afb10c0fe to your computer and use it in GitHub Desktop.
Save mattmetten/d739445f2a0afb10c0fe to your computer and use it in GitHub Desktop.
<!-- Use the following code to detect whether the browser is IE -->
<g:evaluate var="jvar_is_ie">
try {
var isMSIE = Packages.com.glide.sys.Transaction.get().getRequest().getHeader('user-agent').indexOf("MSIE") > 0 ? true : false;
} catch (e) {
isMSIE = false;
}
isMSIE;
</g:evaluate>
<!-- If the browser is IE, set the height & width as a fixed value. If not, set it to just 'expand' -->
<j:switch on="${jvar_is_ie}">
<j:case value="true">
gr.sizing = '';
gr.height = '800px';
gr.width = '1100px';
</j:case>
<j:default>
gr.sizing = 'expand';
</j:default>
</j:switch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment