From c1589cafaaeaa8b8dba374ebecec8cdcd80d7060 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 28 May 2017 13:32:08 -0400 Subject: [PATCH] fix popup panel layout as per feedback: https://github.com/gorhill/uBlock/commit/39aeaa12a73eb1de0cacb35238db61b04a1dfd05#commitcomment-22310294 --- src/css/popup.css | 38 +++++++++++++++++++++----------------- src/js/popup.js | 2 +- src/js/traffic.js | 9 ++++----- src/popup.html | 10 ++++++---- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/css/popup.css b/src/css/popup.css index f4303c7a8..c831beb96 100644 --- a/src/css/popup.css +++ b/src/css/popup.css @@ -29,13 +29,9 @@ h2 { cursor: pointer; font-size: 100%; font-weight: normal; - margin: 1em 0 0.8em 0; padding: 0.2em; text-align: center; } -h2:first-of-type { - margin-top: 0; - } a { color: inherit; text-decoration: none; @@ -150,6 +146,27 @@ p { body.off #switch .fa { color: #ccc; } +#basicTools { + margin: 0.8em 0 0.4em 0; + } +.tool:first-child { + margin-left: 0; + } +.tool { + color: #aaa; + cursor: pointer; + visibility: hidden; + margin-left: 0.8em; + min-width: 1em; + padding: 0 0.2em; + unicode-bidi: embed; + } +.tool.enabled { + visibility: visible; + } +.tool.enabled:hover { + color: #444; + } #page-blocked { font-size: 1.25em; } @@ -163,19 +180,6 @@ body.off #switch .fa { margin: 0; text-align: center; } -.tool { - color: #aaa; - cursor: pointer; - display: none; - min-width: 1em; - unicode-bidi: embed; - } -.tool.enabled { - display: inline-block; - } -.tool:hover { - color: #444; - } #extraTools { background-color: #eee; border: 0; diff --git a/src/js/popup.js b/src/js/popup.js index 27d15f333..9d2bbc229 100644 --- a/src/js/popup.js +++ b/src/js/popup.js @@ -434,7 +434,7 @@ var renderPopup = function() { // https://github.com/gorhill/uBlock/issues/507 // Convenience: open the logger with current tab automatically selected if ( popupData.tabId ) { - uDom.nodeFromSelector('.statName > a[href^="logger-ui.html"]').setAttribute( + uDom.nodeFromSelector('#basicTools > a[href^="logger-ui.html"]').setAttribute( 'href', 'logger-ui.html#tab_' + popupData.tabId ); diff --git a/src/js/traffic.js b/src/js/traffic.js index bb6952fcc..e01331658 100644 --- a/src/js/traffic.js +++ b/src/js/traffic.js @@ -375,11 +375,10 @@ var onBeforeBehindTheSceneRequest = function(details) { context.dispose(); - // Not blocked - if ( result !== 1 ) { return; } - - // Blocked - return { 'cancel': true }; + // Blocked? + if ( result === 1 ) { + return { 'cancel': true }; + } }; /******************************************************************************/ diff --git a/src/popup.html b/src/popup.html index ef4627aaa..008eeb417 100644 --- a/src/popup.html +++ b/src/popup.html @@ -14,12 +14,14 @@

+

+ + + +

 

-   +  

?