-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
106c44d
commit 6ca7988
Showing
6 changed files
with
90 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters