1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Safari: don't need to inject a stylesheet into popup

This commit is contained in:
Chris 2015-03-16 18:08:12 -06:00
parent 924bcfab62
commit 3c9f5c0da1

View File

@ -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);