From 3c9f5c0da172c1aadc5efe06671ca8f0c1eee4f1 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 16 Mar 2015 18:08:12 -0600 Subject: [PATCH] Safari: don't need to inject a stylesheet into popup --- platform/safari/vapi-popup.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/safari/vapi-popup.js b/platform/safari/vapi-popup.js index ce86ea246..ce3819695 100644 --- a/platform/safari/vapi-popup.js +++ b/platform/safari/vapi-popup.js @@ -33,14 +33,15 @@ var onLoaded = function() { }; var body = document.body, popover = safari.self; - var style = document.createElement("style"); - style.textContent = "html,body,#panes{width:100%}#panes{white-space:nowrap;text-align:right}#panes > div:nth-of-type(2){display:inline-block !important}"; - body.appendChild(style); - var panes = document.getElementById("panes"), powerAndStatsPane = panes.children[0], dfPane = panes.children[1]; + body.style.setProperty("width", "100%"); + panes.style.setProperty("text-align", "right"); + panes.style.setProperty("width", "100%"); + dfPane.style.setProperty("display", "inline-block", "important"); + var updateSize = function() { var dfEnabled = panes.classList.contains(DF_ENABLED_CLASS); popover.width = powerAndStatsPane.clientWidth + (dfEnabled ? dfPane.clientWidth : 0);