From 3c16b5c36afdc3845240409542ba68254beff023 Mon Sep 17 00:00:00 2001
From: Nic Wolfe <nic@wolfeden.ca>
Date: Wed, 19 Jan 2011 23:37:38 -0700
Subject: [PATCH] Fix top scroll image for web_root users

---
 data/interfaces/default/inc_top.tmpl   | 3 +++
 data/js/jquery.scrolltopcontrol-1.1.js | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/data/interfaces/default/inc_top.tmpl b/data/interfaces/default/inc_top.tmpl
index c197f96dc..c87304126 100644
--- a/data/interfaces/default/inc_top.tmpl
+++ b/data/interfaces/default/inc_top.tmpl
@@ -56,6 +56,9 @@ table.tablesorter thead tr .headerSortDown { background-image: url("$sbRoot/imag
     <script type="text/javascript" src="$sbRoot/js/jquery.cookie.js"></script>
     <script type="text/javascript" src="$sbRoot/js/jquery.cookiejar.js"></script>
     <script type="text/javascript" src="$sbRoot/js/jquery.json-2.2.min.js"></script>
+    <script type="text/javascript" charset="utf-8">
+    top_image_html = '<img src="$sbRoot/images/top.gif" style="width:31px; height:11px" />'; //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
+    </script>
     <script type="text/javascript" src="$sbRoot/js/jquery.scrolltopcontrol-1.1.js"></script>
     <script type="text/javascript" src="$sbRoot/js/jquery.selectboxes.min.js"></script>
     <script type="text/javascript" src="$sbRoot/js/jquery.tablesorter-2.0.3.min.js"></script>
diff --git a/data/js/jquery.scrolltopcontrol-1.1.js b/data/js/jquery.scrolltopcontrol-1.1.js
index 694de03dc..4a6b4d10d 100644
--- a/data/js/jquery.scrolltopcontrol-1.1.js
+++ b/data/js/jquery.scrolltopcontrol-1.1.js
@@ -9,7 +9,7 @@ var scrolltotop={
 	//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
 	//scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
 	setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
-	controlHTML: '<img src="/images/top.gif" style="width:31px; height:11px" />', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
+	controlHTML: top_image_html,//set in inc_top.tmpl so it can be $sbRooted
 	controlattrs: {offsetx:10, offsety:10}, //offset of control relative to right/ bottom of window corner
 	anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links
 
-- 
GitLab