From bf0b4d0a42d7167c9784f56d4938ace33dece76e Mon Sep 17 00:00:00 2001 From: Allan Jardine <allan.jardine@sprymedia.co.uk> Date: Thu, 30 Apr 2015 14:01:36 +0100 Subject: [PATCH] Dev: Don't syntax highlight in IE6/7 as it slows them down hugely --- .datatables-commit-sync | 2 +- examples/resources/syntax/shCore.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index fe705d23..0211faee 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -95edc5a4c02c6d7a55ca037d08220ca4f276976c +a4e87505aa6087ba76eb5821e76304b7cf78ebf7 diff --git a/examples/resources/syntax/shCore.js b/examples/resources/syntax/shCore.js index 34450094..1af466f9 100644 --- a/examples/resources/syntax/shCore.js +++ b/examples/resources/syntax/shCore.js @@ -302,6 +302,13 @@ var sh = { */ highlight: function(globalParams, element) { + // Don't run the syntax highlighter on IE6/7 as it absolutely kills + // performance + var userAgent = navigator.appVersion; + if (userAgent.indexOf("MSIE 7.") !== -1 || userAgent.indexOf("MSIE 6.") !== -1) { + return; + } + var elements = this.findElements(globalParams, element), propertyName = 'innerHTML', highlighter = null,