From 6ca7988a68ffa4a79a65ce210c80e88911f3a7da Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Sun, 12 Oct 2014 18:20:01 +0200 Subject: [PATCH] Small UI tweaks --- Chrome/fixed_navbar.css | 32 +++++++++++----------- Chrome/manifest.json | 34 ++++++++++++------------ Firefox/data/fixed_navbar.css | 32 +++++++++++----------- Firefox/data/fixed_navbar.js | 50 ++++++++++++++++++++++------------- Firefox/package.json | 2 +- README.md | 14 ++++++---- 6 files changed, 90 insertions(+), 74 deletions(-) diff --git a/Chrome/fixed_navbar.css b/Chrome/fixed_navbar.css index 8ad9a6d..2800267 100644 --- a/Chrome/fixed_navbar.css +++ b/Chrome/fixed_navbar.css @@ -1,24 +1,24 @@ #scrollbarHider { - overflow: hidden; - top: 95px; - bottom: 0px; - position: fixed; - margin-left: -20px; - margin-top: 12px; - margin-bottom: -12px; - width: 181px; + overflow: hidden; + top: 95px; + bottom: 0px; + position: fixed; + margin-left: -20px; + margin-top: 12px; + margin-bottom: -12px; + width: 201px; } #navigationWrapper { - overflow: auto; - height: 100%; - padding-right: 5000px; - padding-left: 20px; - width: 181px; - position: absolute; - top: -12px; + overflow: auto; + height: 100%; + padding-left: 20px; + width: 181px; + position: absolute; + top: -12px; + padding-right: 5000px; } #leftColWrapper { - position: fixed; + position: fixed; } \ No newline at end of file diff --git a/Chrome/manifest.json b/Chrome/manifest.json index 8bf5d1b..24aaa48 100644 --- a/Chrome/manifest.json +++ b/Chrome/manifest.json @@ -1,19 +1,19 @@ { - "name":"FB fixed navbar", - "description":"Freezes left navigation pane on Facebook", - "version":"1.0.0", - "manifest_version":2, - "author": "Philipp Schirmer", - "icons": { - "128": "icons/icon128.png", - "48": "icons/icon48.png" - }, - "content_scripts": [ - { - "matches": ["*://www.facebook.com/*"], - "css": ["fixed_navbar.css"], - "js": ["fixed_navbar.js"], - "run_at": "document_end" - } - ] + "name":"FB fixed navbar", + "description":"Freezes left navigation pane on Facebook", + "version":"1.0.1", + "manifest_version":2, + "author": "Philipp Schirmer", + "icons": { + "128": "icons/icon128.png", + "48": "icons/icon48.png" + }, + "content_scripts": [ + { + "matches": ["*://www.facebook.com/*"], + "css": ["fixed_navbar.css"], + "js": ["fixed_navbar.js"], + "run_at": "document_end" + } + ] } \ No newline at end of file diff --git a/Firefox/data/fixed_navbar.css b/Firefox/data/fixed_navbar.css index 8ad9a6d..2800267 100644 --- a/Firefox/data/fixed_navbar.css +++ b/Firefox/data/fixed_navbar.css @@ -1,24 +1,24 @@ #scrollbarHider { - overflow: hidden; - top: 95px; - bottom: 0px; - position: fixed; - margin-left: -20px; - margin-top: 12px; - margin-bottom: -12px; - width: 181px; + overflow: hidden; + top: 95px; + bottom: 0px; + position: fixed; + margin-left: -20px; + margin-top: 12px; + margin-bottom: -12px; + width: 201px; } #navigationWrapper { - overflow: auto; - height: 100%; - padding-right: 5000px; - padding-left: 20px; - width: 181px; - position: absolute; - top: -12px; + overflow: auto; + height: 100%; + padding-left: 20px; + width: 181px; + position: absolute; + top: -12px; + padding-right: 5000px; } #leftColWrapper { - position: fixed; + position: fixed; } \ No newline at end of file diff --git a/Firefox/data/fixed_navbar.js b/Firefox/data/fixed_navbar.js index 9cb464f..a40d5b7 100644 --- a/Firefox/data/fixed_navbar.js +++ b/Firefox/data/fixed_navbar.js @@ -1,22 +1,34 @@ setInterval(fixNavbar, 50); +window.addEventListener('resize', handleResize); + +function handleResize() { + var scrollbarHider = document.getElementById('scrollbarHider'); + if (scrollbarHider !== null) { + scrollbarHider.style.display = 'none'; + setTimeout(function() { + scrollbarHider.style.display = 'block' + }, 20); + } +} + function fixNavbar() { - var pagelet_navigation = document.getElementById('pagelet_navigation'); - if (document.getElementById('leftColWrapper') === null && pagelet_navigation !== null) { - var mainContainer = document.getElementById('mainContainer'); - var leftCol = document.getElementById('leftCol'); - var contentCol = document.getElementById('contentCol'); - var leftColWrapper = document.createElement('div'); - var scrollbarHider = document.createElement('div'); - var navigationWrapper = document.createElement('div'); - leftColWrapper.id = 'leftColWrapper'; - scrollbarHider.id = 'scrollbarHider'; - navigationWrapper.id = 'navigationWrapper'; - mainContainer - .appendChild(leftColWrapper) - .appendChild(leftCol) - .appendChild(scrollbarHider) - .appendChild(navigationWrapper) - .appendChild(pagelet_navigation); - mainContainer.appendChild(contentCol); - } + var pagelet_navigation = document.getElementById('pagelet_navigation'); + if (document.getElementById('leftColWrapper') === null && pagelet_navigation !== null) { + var mainContainer = document.getElementById('mainContainer'); + var leftCol = document.getElementById('leftCol'); + var contentCol = document.getElementById('contentCol'); + var leftColWrapper = document.createElement('div'); + var scrollbarHider = document.createElement('div'); + var navigationWrapper = document.createElement('div'); + leftColWrapper.id = 'leftColWrapper'; + scrollbarHider.id = 'scrollbarHider'; + navigationWrapper.id = 'navigationWrapper'; + mainContainer + .appendChild(leftColWrapper) + .appendChild(leftCol) + .appendChild(scrollbarHider) + .appendChild(navigationWrapper) + .appendChild(pagelet_navigation); + mainContainer.appendChild(contentCol); + } } \ No newline at end of file diff --git a/Firefox/package.json b/Firefox/package.json index 846d154..61b7603 100644 --- a/Firefox/package.json +++ b/Firefox/package.json @@ -5,5 +5,5 @@ "description": "Freezes left navigation pane on Facebook", "author": "Philipp Schirmer", "license": "MPL 2.0", - "version": "1.0.0" + "version": "1.0.1" } diff --git a/README.md b/README.md index 38afaea..8bf003b 100644 --- a/README.md +++ b/README.md @@ -6,22 +6,26 @@ This tiny extensions freezes the left navigation pane on Facebook so that it is Chrome ------ -Download at [Chrome Web Store](https://chrome.google.com/webstore/detail/hijonlkmghfbdpcmbimegkoogkfpckkl) -Download [.crx](https://github.com/philipp94831/FB-fixed-navbar/releases/download/v1.0.0/FB-fixed-navbar.crx) +Download at [Chrome Web Store](https://chrome.google.com/webstore/detail/hijonlkmghfbdpcmbimegkoogkfpckkl) +Download [.crx](https://github.com/philipp94831/FB-fixed-navbar/releases/download/v1.0.1/FB-fixed-navbar.crx) Firefox ------- -Download at [Add-ons for Firefox](https://addons.mozilla.org/addon/fb-fixed-navbar/) -Download [.xpi](https://github.com/philipp94831/FB-fixed-navbar/releases/download/v1.0.0/FB-fixed-navbar.xpi) +Download at [Add-ons for Firefox](https://addons.mozilla.org/addon/fb-fixed-navbar/) +Download [.xpi](https://github.com/philipp94831/FB-fixed-navbar/releases/download/v1.0.1/FB-fixed-navbar.xpi) -For help, see our [FAQ](https://github.com/philipp94831/FB-fixed-navbar/wiki/FAQ) +For help, see our [FAQ](https://github.com/philipp94831/FB-fixed-navbar/wiki/FAQ) Found a Bug? [File it!](https://github.com/philipp94831/FB-fixed-navbar/issues) === [Changelog:](https://github.com/philipp94831/FB-fixed-navbar/releases) +[1.0.1:](https://github.com/philipp94831/FB-fixed-navbar/releases/tag/v1.0.1) + +- Small UI tweaks + [1.0.0:](https://github.com/philipp94831/FB-fixed-navbar/releases/tag/v1.0.0) - Firefox & Chrome version