Skip to content
Snippets Groups Projects
Commit 2cb17605 authored by Toke Eskildsen's avatar Toke Eskildsen
Browse files

Bugfix: The overlays in folder did not work after sorttable was introduced

parent 95f3481b
No related branches found
No related tags found
No related merge requests found
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Quack - ${SRC_FOLDER}</title> <title>Quack - ${SRC_FOLDER}</title>
<link rel="stylesheet" type="text/css" href="${UP}quack.css" /> <link rel="stylesheet" type="text/css" href="${UP}quack.css" />
<script src="${UP}quack_folder.js"></script>
<script src="${UP}sorttable.js"></script> <script src="${UP}sorttable.js"></script>
<script src="${UP}quack_folder.js"></script>
</head> </head>
<body class="folder"> <body class="folder">
......
...@@ -10,7 +10,7 @@ function toggleBlownThumbs() { ...@@ -10,7 +10,7 @@ function toggleBlownThumbs() {
content[i].style.display = state; content[i].style.display = state;
} }
} }
function toggleHistograms() { function toggleHistograms() {
if (document.getElementById('toggle_histograms').checked) { if (document.getElementById('toggle_histograms').checked) {
thumb_state = 'none'; thumb_state = 'none';
hist_state = 'block'; hist_state = 'block';
...@@ -29,7 +29,19 @@ function toggleHistograms() { ...@@ -29,7 +29,19 @@ function toggleHistograms() {
} }
} }
function setupThumbOverlays() { function thclick() {
// Consider a timeout if there is a race condition with the table sort
// TODO: Order the image divs like the table links are ordered
}
var oldOnload = window.onload;
function initialSetup() {
if (oldOnload != null) {
console.log('Calling previous onLoad');
oldOnload();
}
// Thumb overlays
console.log('Adding thumb overlays');
var content = document.getElementsByClassName('thumblink'); var content = document.getElementsByClassName('thumblink');
for (var i = 0 ; i < content.length ; i++) { for (var i = 0 ; i < content.length ; i++) {
var href = content[i].href; var href = content[i].href;
...@@ -42,5 +54,16 @@ function setupThumbOverlays() { ...@@ -42,5 +54,16 @@ function setupThumbOverlays() {
span.style.background = "url(" + base + ".black.thumb.png) 100% 100%, url(" + base + ".white.thumb.png) 100% 100%"; span.style.background = "url(" + base + ".black.thumb.png) 100% 100%, url(" + base + ".white.thumb.png) 100% 100%";
document.title = span.style.background; document.title = span.style.background;
} }
console.log('Attaching hooks for table sort');
var tables = document.getElementsByClassName('sortable');
for (var i = 0 ; i < tables.length ; i++) {
var stable = tables[i];
var theads = stable.getElementsByTagName('th');
for (var h = 0 ; h < theads.length ; h++) {
thead = theads[h];
thead.onclick = thclick;
}
}
} }
window.onload=setupThumbOverlays; window.onload = initialSetup;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment