diff options
-rw-r--r-- | templates/web/base/common_header_tags.html | 9 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/header.js | 10 |
2 files changed, 6 insertions, 13 deletions
diff --git a/templates/web/base/common_header_tags.html b/templates/web/base/common_header_tags.html index 69b155a9e..21081246d 100644 --- a/templates/web/base/common_header_tags.html +++ b/templates/web/base/common_header_tags.html @@ -1,8 +1,6 @@ [% SET start = c.config.ADMIN_BASE_URL IF admin %] -<meta http-equiv="content-type" content="text/html; charset=utf-8" - id="js-meta-data" data-page="[% page %]" - data-cobrand="[% c.cobrand.moniker %]"> +<meta http-equiv="content-type" content="text/html; charset=utf-8"> [% IF csrf_token %] <meta content="[% csrf_token %]" name="csrf-token" /> @@ -13,9 +11,8 @@ <![endif]--> <script nonce="[% csp_nonce %]"> window.Modernizr=function(e,t,n){function r(e){p.cssText=e}function o(e,t){return typeof e===t}var a,i,c,l="2.8.3",s={},u=t.documentElement,d="modernizr",f=t.createElement(d),p=f.style,m=({}.toString,{}),h=[],y=h.slice,v=function(e,n,r,o){var a,i,c,l,s=t.createElement("div"),f=t.body,p=f||t.createElement("body");if(parseInt(r,10))for(;r--;)c=t.createElement("div"),c.id=o?o[r]:d+(r+1),s.appendChild(c);return a=["­",'<style id="s',d,'">',e,"</style>"].join(""),s.id=d,(f?s:p).innerHTML+=a,p.appendChild(s),f||(p.style.background="",p.style.overflow="hidden",l=u.style.overflow,u.style.overflow="hidden",u.appendChild(p)),i=n(s,e),f?s.parentNode.removeChild(s):(p.parentNode.removeChild(p),u.style.overflow=l),!!i},g=function(t){var n=e.matchMedia||e.msMatchMedia;if(n)return n(t)&&n(t).matches||!1;var r;return v("@media "+t+" { #"+d+" { position: absolute; } }",function(t){r="absolute"==(e.getComputedStyle?getComputedStyle(t,null):t.currentStyle).position}),r},b={}.hasOwnProperty;c=o(b,"undefined")||o(b.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(e,t){return b.call(e,t)};for(var E in m)c(m,E)&&(i=E.toLowerCase(),s[i]=m[E](),h.push((s[i]?"":"no-")+i));return r(""),f=a=null,s._version=l,s.mq=g,s.testStyles=v,s}(this,this.document); - var fixmystreet=fixmystreet||{}; - (function(b){var a=b.documentElement;a.className=a.className.replace(/\bno-js\b/,"js");var c=-1<a.className.indexOf("ie8");c=Modernizr.mq("(min-width: 48em)")||c?"desktop":"mobile";b=b.getElementById("js-meta-data");"IntersectionObserver"in window&&(a.className+=" lazyload");fixmystreet.page=b.getAttribute("data-page");fixmystreet.cobrand=b.getAttribute("data-cobrand");"mobile"==c&&(a.className+=" mobile","around"==fixmystreet.page&&(a.className+=" map-fullscreen only-map map-reporting"))})(document); - + var fixmystreet=fixmystreet||{};fixmystreet.page="[% page %]";fixmystreet.cobrand="[% c.cobrand.moniker %]"; + (function(a){a=a.documentElement;a.className=a.className.replace(/\bno-js\b/,"js");var b=-1<a.className.indexOf("ie8");b=Modernizr.mq("(min-width: 48em)")||b?"desktop":"mobile";"IntersectionObserver"in window&&(a.className+=" lazyload");"mobile"==b&&(a.className+=' mobile[% " map-fullscreen only-map map-reporting" IF page == "around" %]')})(document); </script> [% IF robots %] diff --git a/web/cobrands/fixmystreet/header.js b/web/cobrands/fixmystreet/header.js index 170073ce3..668273078 100644 --- a/web/cobrands/fixmystreet/header.js +++ b/web/cobrands/fixmystreet/header.js @@ -1,22 +1,18 @@ // A minimized version of this is inline in the header. var fixmystreet = fixmystreet || {}; +fixmystreet.page = '[% page %]'; +fixmystreet.cobrand = '[% c.cobrand.moniker %]'; (function(D){ var E = D.documentElement; E.className = E.className.replace(/\bno-js\b/, 'js'); var ie8 = E.className.indexOf('ie8') > -1; var type = Modernizr.mq('(min-width: 48em)') || ie8 ? 'desktop' : 'mobile'; - var meta = D.getElementById('js-meta-data'); if ('IntersectionObserver' in window) { E.className += ' lazyload'; } - fixmystreet.page = meta.getAttribute('data-page'); - fixmystreet.cobrand = meta.getAttribute('data-cobrand'); if (type == 'mobile') { - E.className += ' mobile'; - if (fixmystreet.page == 'around') { - E.className += ' map-fullscreen only-map map-reporting'; - } + E.className += ' mobile[% " map-fullscreen only-map map-reporting" IF page == "around" %]'; } })(document); |