From f0f2c8b7cea9eaeeb4e801b9af64a3721d80f73f Mon Sep 17 00:00:00 2001 From: Heydon Pickering Date: Thu, 24 Aug 2017 17:01:28 +0100 Subject: [PATCH] template element polyfill --- docs/js/dom-scripts.js | 27 ++++++++++++++++++++++++ docs/service-worker.js | 2 +- themes/infusion/static/js/dom-scripts.js | 27 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/docs/js/dom-scripts.js b/docs/js/dom-scripts.js index c0f3557..7ff7deb 100644 --- a/docs/js/dom-scripts.js +++ b/docs/js/dom-scripts.js @@ -130,3 +130,30 @@ } }); }()); + +/* Template element polyfill */ +(function templatePolyfill(d) { + if('content' in d.createElement('template')) { + return false; + } + + var qPlates = d.getElementsByTagName('template'), + plateLen = qPlates.length, + elPlate, + qContent, + contentLen, + docContent; + + for(var x=0; x